The HASH directive generates a message digest.
Syntax
Code Block |
---|
hash <column> <algorithm> [<encode>:column 'algorithm' [encode (true/false)] |
The <column>
column
is the name of the column to which the hashing <algorithm>
is applied.
If <encode>
encode
is set to true
, the hashed digest is encoded as hex
with left-padding zeroes. By default, <encode>
encode
is set to true
. To disable hex
encoding, set <encode>
encode
to false.
Usage Notes
The HASH directive, when applied on a <column>
column
, will replace the content of the column with the message hash. No new columns are created with the application of this directive.
...
Applying this directive:
Code Block |
---|
hash :message 'SHA3-384' |
would generate generates a message digest and replace replaces the column with it:
Code Block |
---|
{ "message": "9cc25835d1ef78b4cd8b36a0c4ad636a6094fbb944b1d880f21c7129a645e819d3be987e8ae2f0f8d6cbebb8452419ef" } |
...
Note: By default, encoding is on. When <encode>
encode
is set to false
, the output column type is a byte array.