def update_hash_from_str ( hsh , str_input ) : byte_input = str ( str_input ) . encode ( "UTF-8" ) hsh . update ( byte_input )
cast hash to string python
Convert a str to object supporting buffer API and update a hash with it .
def update_hash_from_str(hsh, str_input):
    """
    Convert a str to object supporting buffer API and update a hash with it.
    """
    byte_input = str(str_input).encode("UTF-8")
    hsh.update(byte_input)