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)
def update_hash_from_str ( hsh , str_input ) : byte_input = str ( str_input ) . encode ( "UTF-8" ) hsh . update ( byte_input )
Convert a str to object supporting buffer API and update a hash with it.