Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/getting-started/gs-normalization-encoding.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: Normalization and encoding
description: Learn how to normalize and encode information so it's secure and can be decoded.
title: Normalization, hashing, and encoding
description: Instructions for normalizing, hashing, and encoding email addresses and phone numbers.
hide_table_of_contents: false
displayed_sidebar: docs
---

import Link from '@docusaurus/Link';

# Normalization and encoding
# Normalization, hashing, and encoding

This page provides information about normalizing and encoding <Link href="../ref-info/glossary-uid#gl-dii">DII</Link>. It's important that, in working with UID2, normalizing and encoding are performed correctly.
This page provides information about normalizing, hashing, and encoding <Link href="../ref-info/glossary-uid#gl-dii">DII</Link>. It's important that, in working with UID2, normalizing, hashing, and encoding are performed correctly.

## Introduction

Expand Down Expand Up @@ -53,7 +53,7 @@ Make sure that the normalized email is UTF-8, not another encoding system such a

For examples of various scenarios, see [Normalization examples for email](#normalization-examples-for-email).

## Email address hash encoding
## Email address hashing and encoding

An email hash is a Base64-encoded <Link href="../ref-info/glossary-uid#gl-sha-256">SHA-256</Link> hash of a normalized email address. The email address is first normalized, then hashed using the SHA-256 hashing algorithm, and then the resulting bytes of the hash value are encoded using Base64 encoding. Note that the Base64 encoding is applied to the bytes of the hash value, not the hex-encoded string representation.

Expand Down Expand Up @@ -140,7 +140,7 @@ Here's what you need to know about phone number normalization rules:
Make sure that the normalized phone number is UTF-8, not another encoding system such as UTF-16.
:::

## Phone number hash encoding
## Phone number hashing and encoding

A phone number hash is a Base64-encoded SHA-256 hash of a normalized phone number. The phone number is first normalized, then hashed using the SHA-256 hashing algorithm, and then the resulting bytes of the hash value are encoded using Base64 encoding. Note that the Base64 encoding is applied to the bytes of the hash value, not the hex-encoded string representation.

Expand Down Expand Up @@ -213,4 +213,4 @@ If you're having trouble or getting errors, or if you just want to be sure you'r

- **Use the Base64-encoded value**: The process includes normalizing, then hashing, then Base64-encoding the bytes of the hash value. When generating UID2s, the input is the Base64-encoded value. Make sure you're using this 44-character string value.

- You might see the following error message: "The hashing value must be 44 characters." In this scenario, there is an error with the hashing function you're using. Use the hex to Base64 encoding of the SHA-256 hash. For details, see [Email address hash encoding](#email-address-hash-encoding) or [Phone number hash encoding](#phone-number-hash-encoding). To cross-check, test using the [UID2 hashing tool](https://hashing-tool.samples.uidapi.com/).
- You might see the following error message: "The hashing value must be 44 characters." In this scenario, there is an error with the hashing function you're using. Use the hex to Base64 encoding of the SHA-256 hash. For details, see [Email address hashing and encoding](#email-address-hash-encoding) or [Phone number hashing and encoding](#phone-number-hash-encoding). To cross-check, test using the [UID2 hashing tool](https://hashing-tool.samples.uidapi.com/).
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ If you're using a UID2 SDK, or other integration solution such as the Prebid.js
</tr>
<tr>
<td>Phone Number</td>
<td>Must be one of the following:<ul><li>Normalized, including country code</li><li>Normalized, then hashed, then base64-encoded</li></ul></td>
<td>[Phone number normalization](../getting-started/gs-normalization-encoding#phone-number-normalization)<br/>[Phone number hash encoding](../getting-started/gs-normalization-encoding#phone-number-hash-encoding)</td>
<td>Must be one of the following:<ul><li>Normalized raw phone number, including country code</li><li>Normalized, then hashed, then base64-encoded</li></ul></td>
<td>[Phone number normalization](../getting-started/gs-normalization-encoding#email-address-normalization)<br/>[Phone number hashing and encoding](../getting-started/gs-normalization-encoding#phone-number-hashing-and-encoding)</td>
</tr>
</tbody>
</table>
4 changes: 2 additions & 2 deletions docs/ref-info/updates-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ We clarified the instructions for normalizing and encoding <Link href="../ref-in

For details, see:

- [Email address hash encoding](../getting-started/gs-normalization-encoding#email-address-hash-encoding)
- [Phone number hash encoding](../getting-started/gs-normalization-encoding#phone-number-hash-encoding)
- [Email address hashing and encoding](../getting-started/gs-normalization-encoding#email-address-hashing-and-encoding)
- [Phone number hashing and encoding](../getting-started/gs-normalization-encoding#phone-number-hashing-and-encoding)

</CustomTagsContainer>

Expand Down
Loading