import hashlib


def hash_word(text, algo):
    """ Takes plain text and hashing algorithm from user and returns the hashed value.

    Args:
        text ([string]): Plain text to be hashed.
        algo ([string]): Algorithm to be used for hashing.

    Returns:
        hashed_word([str]): Hashed value of the plain text passed.
    """
    hashed_word = hashlib.new(algo)
    hashed_word.update(text.encode())
    return hashed_word.hexdigest()