Menu

Unicode Normalization and Exact-Match Validation for Redemption Codes
📰

Unicode Normalization and Exact-Match Validation for Redemption Codes

#hackernoon#technology#code#issuer#characters
Reading 0:00
15s threshold

A customer copies a short code from a message and pastes it into a redemption form. The code looks right, but the server rejects it. A support agent types what appears to be the same characters and gets a different result. The first instinct is to “clean up” the input before comparing it. That can be reasonable for a search box. For a value-bearing code, it can create an accidental alias.

The issue is that a code is an identifier with an issuer-defined alphabet, not free-form prose. Two strings that look alike may contain different Unicode characters. Conversely, a broad normalization step can map distinct strings to the same result. The correct behavior depends on the contract for the particular code format.

One example; three inputs

Take the fictional code AB-12 . The second string below uses fullwidth Latin letters and digits.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.