sha2
function
Applies to: Databricks SQL Databricks Runtime
Returns a checksum of the SHA-2
family as a hex string of expr
.
sha2(expr, bitLength)
expr
: ABINARY
orSTRING
expression.bitLength
: AnINTEGER
expression.
A STRING.
bitLength
can be 0, 224
, 256
, 384
, or 512
.
bitLength
0 is equivalent to 256
.
>> SELECT sha2('Spark', 256);
529bc3b07127ecb7e53a4dcf1991d9152c24537d919178022b2c42657f79a26b