'Return instantiated hash function for the hash type supported by
the provider.'

def _get_hash_function(self):

    try:
        func = getattr(hashlib, self.hash_type)()
    except AttributeError:
        raise RuntimeError(('Invalid    or    unsupported    hash    type:    %s' % self.hash_type))
    return func
