def METHOD_NAME(value, algorithm="sha512"):
    """
    .. versionadded:: 2014.7.0
    Encodes a value with the specified encoder.
    value
        The value to be hashed.
    algorithm : sha512
        The algorithm to use. May be any valid algorithm supported by
        hashlib.
    CLI Example:
    .. code-block:: bash
        salt '*' random.hash 'I am a string' md5
    """
    return salt.utils.data.METHOD_NAME(value, algorithm=algorithm)