Skip to content

Commit a616a3f

Browse files
authored
Merge pull request #923 from IABTechLab/gwh-APIDOCS-3315-04-uid2-normalization-example-update
mods to normalization doc
2 parents 3c9867d + 233a23a commit a616a3f

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

docs/getting-started/gs-normalization-encoding.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ An email hash is a Base64-encoded <Link href="../ref-info/glossary-uid#gl-sha-25
6060

6161
| Type | Example | Comments and Usage |
6262
| :--- | :--- | :--- |
63+
| Raw email address | `[email protected]` | N/A |
6364
| Normalized email address | `[email protected]` | Normalization is always the first step. |
6465
| SHA-256 hash of normalized email address | `b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514` | This 64-character string is a hex-encoded representation of the 32-byte SHA-256. |
6566
| Hex to Base64 encoding of SHA-256 hash | `tMmiiTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ=` | This 44-character string is a Base64-encoded representation of the 32-byte SHA-256.<br/>WARNING: The SHA-256 hash string in the example above is a hex-encoded representation of the hash value. You must Base64-encode the raw bytes of the hash or use a Base64 encoder that takes a hex-encoded value as input.<br/>Use this encoding for `email_hash` values sent in the request body. |
@@ -70,6 +71,21 @@ When applying Base64 encoding, be sure to Base64-encode the raw bytes of the has
7071

7172
For additional examples, see [Normalization Examples for Email](#normalization-examples-for-email).
7273

74+
## Normalization Examples for Email
75+
76+
The following table shows examples of original email addresses and the normalized and hashed values.
77+
78+
Some of the examples show email addresses that include the plus sign (+), with different domains. For `gmail` addresses, the plus sign and following characters, up to the `@` sign, are ignored in normalization. For other domains, these characters are included in the normalized value.
79+
80+
| Original Value | Normalized | Hashed and Base64-Encoded |
81+
| :--- | :--- | :--- |
82+
| `[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: `16c18d336f0b250f0e2d907452ceb9658a74ecdae8bc94864c23122a72cc27a5`<br/>Base64-Encoded: `FsGNM28LJQ8OLZB0Us65ZYp07NrovJSGTCMSKnLMJ6U=` |
83+
| `[email protected]` | `[email protected]` | Hashed: `e22b53bc6f871274f3a62ab37a3caed7214fc14d676215a96a242fcfada1c81f`<br/>Base64-Encoded: `4itTvG+HEnTzpiqzejyu1yFPwU1nYhWpaiQvz62hyB8=` |
84+
| `[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: `d6670e7a92007f1b5ff785f1fc81e53aa6d3d7bd06bdf5c473cdc7286c284b6d`<br/>Base64-Encoded: `1mcOepIAfxtf94Xx/IHlOqbT170GvfXEc83HKGwoS20=` |
85+
| `[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: ` b196432c7b989a2ca91c83799957c515da53e6c13abf20b78fea94f117e90bf8`<br/>Base64-Encoded: `sZZDLHuYmiypHIN5mVfFFdpT5sE6vyC3j+qU8RfpC/g=` |
86+
| `[email protected]` | `[email protected]` | Hashed: `28aaee4815230cd3b4ebd88c515226550666e91ac019929e3adac3f66c288180`<br/>Base64-Encoded: `KKruSBUjDNO069iMUVImVQZm6RrAGZKeOtrD9mwogYA=` |
87+
| `[email protected]`<br/>`[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: `92ee26057ed9dea2535d6c8b141d48373932476599196e00352254896db5888f`<br/>Base64-Encoded: `ku4mBX7Z3qJTXWyLFB1INzkyR2WZGW4ANSJUiW21iI8=` |
88+
7389
## Phone Number Normalization
7490

7591
:::important
@@ -99,6 +115,7 @@ The following table shows an example of a simple input phone number, and the res
99115

100116
| Type | Example | Comments and Usage |
101117
| :--- | :--- | :--- |
118+
| Raw phone number | `1 (234) 567-8901` | N/A |
102119
| Normalized phone number | `+12345678901` | Normalization is always the first step. |
103120
| SHA-256 hash of normalized phone number | `10e6f0b47054a83359477dcb35231db6de5c69fb1816e1a6b98e192de9e5b9ee` |This 64-character string is a hex-encoded representation of the 32-byte SHA-256. |
104121
| Hex to Base64 encoding of SHA-256 hash | `EObwtHBUqDNZR33LNSMdtt5cafsYFuGmuY4ZLenlue4=` | This 44-character string is a Base64-encoded representation of the 32-byte SHA-256.<br/>NOTE: The SHA-256 hash is a hexadecimal value. You must use a Base64 encoder that takes a hex value as input. Use this encoding for `phone_hash` values sent in the request body. |
@@ -107,21 +124,6 @@ The following table shows an example of a simple input phone number, and the res
107124
When applying Base64 encoding, be sure to use a function that takes a hex value as input. If you use a function that takes text as input, the result is a longer string which is invalid for the purposes of UID2.
108125
:::
109126

110-
## Normalization Examples for Email
111-
112-
The following table shows examples of original email addresses and the normalized and hashed values.
113-
114-
Some of the examples show email addresses that include the plus sign (+), with different domains. For `gmail` addresses, the plus sign and following characters, up to the `@` sign, are ignored in normalization. For other domains, these characters are included in the normalized value.
115-
116-
| Original Value | Normalized | Hashed and Base64-Encoded |
117-
| :--- | :--- | :--- |
118-
| `[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: `16c18d336f0b250f0e2d907452ceb9658a74ecdae8bc94864c23122a72cc27a5`<br/>Base64-Encoded: `FsGNM28LJQ8OLZB0Us65ZYp07NrovJSGTCMSKnLMJ6U=` |
119-
| `[email protected]` | `[email protected]` | Hashed: `e22b53bc6f871274f3a62ab37a3caed7214fc14d676215a96a242fcfada1c81f`<br/>Base64-Encoded: `4itTvG+HEnTzpiqzejyu1yFPwU1nYhWpaiQvz62hyB8=` |
120-
| `[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: `d6670e7a92007f1b5ff785f1fc81e53aa6d3d7bd06bdf5c473cdc7286c284b6d`<br/>Base64-Encoded: `1mcOepIAfxtf94Xx/IHlOqbT170GvfXEc83HKGwoS20=` |
121-
| `[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: ` b196432c7b989a2ca91c83799957c515da53e6c13abf20b78fea94f117e90bf8`<br/>Base64-Encoded: `sZZDLHuYmiypHIN5mVfFFdpT5sE6vyC3j+qU8RfpC/g=` |
122-
| `[email protected]` | `[email protected]` | Hashed: `28aaee4815230cd3b4ebd88c515226550666e91ac019929e3adac3f66c288180`<br/>Base64-Encoded: `KKruSBUjDNO069iMUVImVQZm6RrAGZKeOtrD9mwogYA=` |
123-
| `[email protected]`<br/>`[email protected]`<br/>`[email protected]` | `[email protected]` | Hashed: `92ee26057ed9dea2535d6c8b141d48373932476599196e00352254896db5888f`<br/>Base64-Encoded: `ku4mBX7Z3qJTXWyLFB1INzkyR2WZGW4ANSJUiW21iI8=` |
124-
125127
## Example Code
126128

127129
For an example of how to generate email and phone hashes in JavaScript, see [Example Code: Hashing and Base-64 Encoding](../guides/integration-javascript-client-side#example-code-hashing-and-base-64-encoding).

0 commit comments

Comments
 (0)