QuestionQ236

VerifiedEnsuring Data Security and Compliance

A data engineer is masking a provided data column that contains email addresses. The goal is to produce output of identical length for every row while retaining distinct outputs for different values.

Which SQL function should be used to accomplish this?

Explanation

sha2(email, 0) computes a SHA-256 hash for each email value and returns it as a fixed-length hexadecimal string. A bit length of 0 is equivalent to 256, producing a consistent 64-character digest while deterministically varying with the input value.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!