import _hashlib


def __hash_new(name, string='', usedforsecurity=True):
    """new(name, string='') - Return a new hashing object using the named algorithm;
    optionally initialized with a string.

    Override 'usedforsecurity' to False when using for non-security purposes in
    a FIPS environment
    """
    try:
        return _hashlib.new(name, string, usedforsecurity)
    except ValueError:
        raise