Class SHA256MaskFactory
Masking strategy that masks String, Varchar, Char and Binary types as SHA 256 hash.
For String type: All string type of any length will be converted to 64 character length SHA256 hash encoded in hexadecimal.
For Varchar type: For Varchar type, max-length property will be honored i.e. if the length is less than max-length then the SHA256 hash will be truncated to max-length. If max-length is greater than 64 then the output is the sha256 length, which is 64.
For Char type: For Char type, the length of mask will always be equal to specified max-length. If the given length (max-length) is less than SHA256 hash length (64) the mask will be truncated. If the given length (max-length) is greater than SHA256 hash length (64) then the mask will be padded by blank spaces.
For Binary type: All Binary type of any length will be converted to 32 byte length SHA256 hash.
-
Method Summary
Modifier and TypeMethodDescriptionprotected DataMaskbuildBinaryMask(TypeDescription schema) protected DataMaskbuildBooleanMask(TypeDescription schema) protected DataMaskbuildDateMask(TypeDescription schema) protected DataMaskbuildDecimalMask(TypeDescription schema) protected DataMaskbuildDoubleMask(TypeDescription schema) protected DataMaskbuildLongMask(TypeDescription schema) protected DataMaskbuildStringMask(TypeDescription schema) protected DataMaskbuildTimestampMask(TypeDescription schema) static StringprintHexBinary(byte[] data) Methods inherited from class org.apache.orc.impl.mask.MaskFactory
build, buildChildren, buildStructMask
-
Method Details
-
printHexBinary
-
buildBinaryMask
- Specified by:
buildBinaryMaskin classMaskFactory
-
buildBooleanMask
- Specified by:
buildBooleanMaskin classMaskFactory
-
buildLongMask
- Specified by:
buildLongMaskin classMaskFactory
-
buildDecimalMask
- Specified by:
buildDecimalMaskin classMaskFactory
-
buildDoubleMask
- Specified by:
buildDoubleMaskin classMaskFactory
-
buildStringMask
- Specified by:
buildStringMaskin classMaskFactory
-
buildDateMask
- Specified by:
buildDateMaskin classMaskFactory
-
buildTimestampMask
- Specified by:
buildTimestampMaskin classMaskFactory
-