There is no truly unique identifier (yet) for a given address. The Delivery Point Barcode (DPBC), while close to being unique, isn't accurate enough to distinguish apartments within the same building. ZIP Codes are subject to change, which would alter the DPBC as well. Your best bet for a unique identifier for any given address would be to take the standardized version of the address (minus the fickle ZIP Code) and present it as a string. For example,
742 Evergreen Terrace, Springfield, ORas a unique ID string would be
Many people need to identify address duplicates in their databases. This can be difficult since you may have the same address formatted differently. For example:
(a) 360 N Bedford Suite 204 Beverly Hills CA 90210-5124 (b) 360 North Bedford Dr # 204 Beverly Hills CA 90210-5124
Because of the different formatting, they're hard to catch as duplicates. However, you'll notice that the Delivery Point Barcode (DPBC) is the same for both. This is because the DPBC is the same for every apartment belonging to the main address.
Using the DPBC alone sometimes isn't unique enough, especially if you have multiple units in the same building that you don't want to deduplicate. So if you were to add the secondary number (apartment, suite, unit, room...) to the DPBC you would have a solution that works much more robustly. Our system returns the secondary_number (if it detects one). So, adding the secondary number to the mix, you would have: DPBC+: 902105124547204. This system would certainly allow you to quickly determine a duplicate.
Note: There is no truly unique identifier (yet) for a given address. 4% of ZIP Codes change each month. Boundaries are realigned as delivery routes change. Remember, the USPS owns the ZIP Codes and they change them anytime it is convenient for them. Since the DPBC is based on the ZIP Code, if that changes, the DPBC would change. Thus, today 902105124547 could represent that specific address but tomorrow it could be represented by a different DPBC due to a ZIP Code change.
What doesn't change, usually, is the address of the house. The standardized version of the address, 360 N Bedford Dr Ste 204 Beverly Hills CA, is probably going to be the address for the building and apartment for a long time to come. That's much more stable than including the ZIP Code, which is arbitrary. Cities, on the other hand, rarely change their name. States very rarely change their name, and the state abbreviation can't get any smaller than two characters. In order to change the primary number from 360 to 380, the building would need to move. So a better unique identifier might be the standardized address, minus the ZIP Code, as a string: 360NBedfordDrSte204BeverlyHillsCA.