snowflake.snowpark.functions.sha1_binary

snowflake.snowpark.functions.sha1_binary(msg: Union[snowflake.snowpark.column.Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.43.0/src/snowflake/snowpark/_functions/scalar_functions.py#L4161-L4179)

Returns the SHA-1 hash of the input message as a binary value.

Parameters:

msg (ColumnOrName) – The input message to hash.

Returns:

The SHA-1 hash as a binary value.

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import col
>>> df = session.create_dataframe([["Snowflake"], ["test"], ["hello"]], schema=["msg"])
>>> df.select(sha1_binary(col("msg")).alias("sha1_result")).collect()
[Row(SHA1_RESULT=bytearray(b'\xfd\xa7k\x0b\xcc\x1e\x87\xcf%\x9b\x1d\x1e2q\xd7oY\x0f\xb5\xdd')), Row(SHA1_RESULT=bytearray(b'\xa9J\x8f\xe5\xcc\xb1\x9b\xa6\x1cL\x08s\xd3\x91\xe9\x87\x98/\xbb\xd3')), Row(SHA1_RESULT=bytearray(b'\xaa\xf4\xc6\x1d\xdc\xc5\xe8\xa2\xda\xbe\xde\x0f;H,\xd9\xae\xa9CM'))]
Copy
语言: 中文