---
updatedAt: 2026-04-07T10:11:18.000Z
agentTools:
  siteIndex: https://developers.liveramp.com/llms.txt
  projectIndex: https://developers.liveramp.com/authenticatedtraffic-api/v1.0/llms.txt
---

# Data Pre-Processing and Hashing

To improve your match rate to audience data, we recommend some basic steps to ensure you call the API with valid identifiers.

*For emails:*

1. Remove whitespace. Spaces, tabs and other empty characters should be removed from the plaintext email.
2. Downcase. Convert any cApiTaL letters into the lower case equivalent.
3. Evaluate against a [regular expression](https://emailregex.com/).
4. Drop "fake" emails. Samples below.

[block:code]
{
  "codes": [
    {
      "code": "test@example.com\ntest@gmail.com\ntesting@test.com\nuser@example.com",
      "language": "text",
      "name": "Fake Emails"
    }
  ]
}
[/block]

*For phone numbers*, ensure you remove any country codes or formatting before SHA1 hashing, e.g.:

`+1 (415) 555-6656` should become `4155556656` before hashing.

[block:api-header]
{
  "title": "Hashing Code Samples"
}
[/block]

While ats.js hashes any identifiable identifiers on the client before calling the API, you may wish to provide hashed values directly in your ATS configuration for extra assurance.

We recommend using a library like [jshashes](https://github.com/h2non/jshashes) on the web or node.

[block:code]
{
  "codes": [
    {
      "code": "import hashlib\n\ndef get_hashes(message):\n        hash_result = {}\n        hash_result['md5'] = hashlib.md5(message).hexdigest()\n        hash_result['sha1'] = hashlib.sha1(message).hexdigest()\n        hash_result['sha256'] = hashlib.sha256(message).hexdigest()\n        return hash_result\n\ninput_email = 'Imeyers@LIVERAMP.com '.lower().strip().encode('utf-8')\nprint(get_hashes(input_email))",
      "language": "python",
      "name": "Python3"
    }
  ]
}
[/block]