Forum Discussion
Generate unique ID from various columns
It's generally easier to create an index rather than a suitable hash value.
Also, be aware that restricting to 8 decimal digits limits you to no more than 1 million unique IDs, so you'll need to worry about hash collisions if your data is close to that size or larger.
I've used indices before - unfortunately, in this case, the 8-digit number needs to be a "shorthand" version of the longer account string so that it can readily identify the account. I shouldn't wind up with more than a few hundred of these IDs - no worries about millions.
- AlexisOlson4 years agoSuper User
Uniquely representing 8 different structures corresponding to 8 digits won't be possible unless all of these structures have 10 or fewer distinct values. Even if this is the case, you'd have to map, e.g., "52305" and "52210" to a single digit, in which case it won't be a shorthand since you cannot map both of these to "5".