The hash lookup policy uses a lookup table to mask data according to a hashed value derived from a source attribute.
You can use options to specify characters that will be trimmed from the source value and convert the value to upper case before it is hashed. You can also enter a seed value to vary the calculation performed by the hashing algorithm.
The lookup table must include a key column that contains sequential number values without any gaps, and the remaining columns contain replacement values. The key column must be a numeric data type. The lookup table is typically indexed. The function hashes a source attribute to derive sequential numbers from 1 to the maximum value in the key column of the lookup table. The hashed value from the source attributte is matched with the sequential numbers in the lookup table, and values from the corresponding lookup table row are inserted at the destination.
If a source column used to derive the hashed value contains certain values (NULL, spaces (for CHAR columns), and zero-length VARCHAR), the value is not hashed and the following reserved values are used as keys to the lookup table:
Source Value | Lookup Table Key |
---|---|
NULL | -1 |
spaces (CHAR or VARCHAR) | -2 |
zero-length VARCHAR | -3 |
multiple hash lookup columns where all values are one or more of the following values: NULL, spaces (CHAR or VARCHAR), or zero-length VARCHAR | -4 |