pyspark.sql.functions.sha1

pyspark.sql.functions.sha1(col)[source]

Returns the hex string result of SHA-1.

New in version 1.5.0.

Examples

>>> spark.createDataFrame([('ABC',)], ['a']).select(sha1('a').alias('hash')).collect()
[Row(hash='3c01bdbb26f358bab27f267924aa2c9a03fcfdb8')]