HASH
Overview
The Hash operation allows you to hash one or more columns using a hash algorythm.
Syntax
Applies a hash algorythm to all the values of one or more columns.
HASH COLUMNS '<field>{,...}'
USING < MD5 | SHA1 | SHA256 | SHA384 | SHA512 >
{ < ASCII | UTF8 | UNICODE > }
{ WITH
TRUNCATE
}
;COLUMNS |
Comma-separated list of columns to hash |
HASH |
The hashing algorythm to use (MD5,SHA1,SH256,SHA384,SHA512) |
ENCODING |
The encoding to use when calculating the hash value (ASCII,UTF8,UNICODE) |
TRUNCATE |
Truncates the hash value if necessary to match the original length of the column |
Example 1
-- This HTTP request uses the Rss Feed connection and calls the /econi.xml relative URL SELECT * FROM HTTP [Rss Feed] (GET /econi.xml) APPLY TX (//item); APPLY PIPELINE ( -- Hash the title field using SHA1 HASH COLUMNS 'title' USING SHA1; );
Example 2
-- This HTTP request uses the Rss Feed connection and calls the /econi.xml relative URL SELECT * FROM HTTP [Rss Feed] (GET /econi.xml) APPLY TX (//item); APPLY PIPELINE ( -- Hash the title and category fields using SHA256 with UTF8 encoding and truncate the hash values generated if necessary -- to match the original field length -- In this example, multiple fields are specified for hashing HASH COLUMNS 'title, [category]' USING SHA256 UTF8 WITH TRUNCATE; );