Skip to main content

Step 4: Replace the user name

Derive an identifier from the source name, remove the name, then attach the identifier to the new root object.

User-name mapping
- mapping: |
root = this.without("user_name")

root.user_id = "user_" + this.user_name.hash(
"hmac_sha256",
env("USER_SALT")
).encode("hex").slice(0, 12)

Truncation increases collision risk, and names are weak source identifiers. Evaluate both properties before using this pattern for joins.

Next: reduce location precision.