Skip to main content
Delphix

Algorithm: Repeat First Digit (ZIP-4) (KBA4071)

 

KBA

KBA# 4071

At a Glance  

Versions: Applicable Delphix Masking versions: 4.x, 5.0.x, 5.1.x, 5.2.x, 5.3.x
Description: This algorithm is for 4, 9, and 14 ZIP+4 code (plus-four codes) and repeats the first digit of the 4 last digits and pads with the first number. The rest of the numbers are the same. In the postal system, this extended code is used to identify a geographic segment within the five-digit delivery area.

 

Patterns: This algorithm matches and masks the extended part of the ZIP code. The following patterns are masked: 
  • 4 digit extended code (ZIP is stored in another field).
  • 9 digit ZIP+4 - this masks the 4 extended code leaving ZIP unmasked. 
  • 9 digit ZIP+4 with delimited ('-' or '.') (length 10). 
Characteristics:

Type
Unique
Lookup1
Referential
Integrity2

1:1 Mapping3
Code based n/a Yes  No

1 Unique Lookup - Not applicable. 
2 Referential Integrity - The masked value will be the same between tables, databases, and jobs.
3 1:1 Mapping - The masked value will be mapped uniquely to the input value.

Character 
Encoding:
ASCII Numbers.
Limitations: * Works only on the US postal codes.

Example

 

The example below shows normal data with numbers with different lengths, then additional values that are unmasked and followed by additional values that are masked.  

ZIP+4 masked 
+----+-----------------+-----------------+
| ID | Orig            | Mask            |
+----+-----------------+-----------------+
| 1  | 1234            | 1111            | << Masked 4: 4 digits - len 4
| 2  |  1234           | 1111            | << Masked 4: 4 digits - len 4
| 3  | 4321            | 4444            | << Masked 4: 4 digits - len 4
| 4  | 123456789       | 123456666       | << Masked 4: 9 digits - len 9
| 5  | 12345-6789      | 12345-6666      | << Masked 4: 9 digits - len 10
| 6  | 12345.6789      | 12345.6666      | << Masked 4: 9 digits - len 10
| 7  | 12345678901234  | 123456666       | << Masked 4: 14 digits - len 14
+----+-----------------+-----------------+

Additional masked
+----+-----------------+-----------------+
| 8  | 12AB56789       | 12AB56666       | << Masked 4: Len 9
| 9  | AB1256789       | AB1256666       | << Masked 4: Len 9
| 10 | -123456789      | -123456666      | << Masked 4: 9 digits - len 10
| 11 | 12AB5678901234  | 12AB56666       | << Masked 4: Len 14
| 12 | AB125678901234  | AB1256666       | << Masked 4: Len 14
| 13 | 123456789AB234  | AB1256666       | << Masked 4: Len 14
| 14 | 123456789012AB  | AB1256666       | << Masked 4: Len 14
+----+-----------------+-----------------+

Unmasked (3 masked examples shown as reference)
+----+-----------------+-----------------+
| 15 | NULL            | NULL            |
| 16 |                 |                 |
| 17 | 1               | 1               |
| 18 | 12              | 12              |
| 19 | 123             | 123             |
| 1  | 1234            | 1111            | << Masked: Len 4
| 20 | 12345           | 12345           |
| 21 | 123456          | 123456          |
| 22 | 1234567         | 1234567         |
| 23 | 12345678        | 12345678        |
| 4  | 123456789       | 123456666       | << Masked: Len 9
| 24 | 1234567890      | 1234567890      |
| 25 | 12345678901     | 12345678901     |
| 26 | 123456789012    | 123456789012    |
| 27 | 1234567890123   | 1234567890123   |
| 8  | 12345678901234  | 123456666       | << Masked: Len 14
| 28 | 123456789012345 | 123456789012345 |
+----+-----------------+-----------------+

Additional unmasked
+----+-----------------+-----------------+
| 29 | ABCD            | ABCD            |
| 30 | 4ABC            | 4ABC            |
| 31 | A123            | A123            |
| 32 | ABCDE           | ABCDE           |
| 33 | 123456789-      | 123456789-      |
+----+-----------------+-----------------+

Applicable Delphix Versions

This article applies to the following versions of the Delphix Engine:

Major Release

All Sub Releases

5.3 5.3.0.0
5.2 5.2.2.0, 5.2.2.1, 5.2.3.0, 5.2.4.0, 5.2.5.0, 5.2.5.1, 5.2.6.0, 5.2.6.1

5.1

5.1.0.0, 5.1.1.0, 5.1.2.0, 5.1.3.0, 5.1.4.0, 5.1.5.0, 5.1.5.1, 5.1.6.0, 5.1.7.0, 5.1.8.0, 5.1.8.1, 5.1.9.0, 5.1.10.0

5.0

5.0.1.0, 5.0.1.1, 5.0.2.0, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.3.0, 5.0.3.1, 5.0.4.0, 5.0.4.1 ,5.0.5.0, 5.0.5.1, 5.0.5.2, 5.0.5.3, 5.0.5.4

4.3

4.3.1.0, 4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