def compute_hash(func, string):
    """compute hash of string using given hash function"""
    h = func()
    h.update(string)
    return h.hexdigest()
def compute_hash ( func , string ) : h = func ( ) h . update ( string ) return h . hexdigest ( )
compute hash of string using given hash function