java - Mapping Unique 16-Digit numeric ID to Unique Alphanumeric ID -


in project i'm working on, need generate 16 character long unique ids, consisting of 10 numbers plus 26 uppercase letters (only uppercase). must guaranteed universally unique, 0 chance of repeat ever.

the ids not stored forever. id thrown out of database after period of time , new unique id must generated. ids can never repeat thrown out ones either.

so randomly generating 16 digits , checking against list of generated ids not option because there no comprehensive list of previous ids. also, uuid not work because ids must 16 digits in length.

right i'm using 16-digit unique ids, guaranteed universally unique every time they're generated (i'm using timestamps generate them plus unique server id). however, need ids difficult predict, , using timestamps makes them easy predict.

so need map 16 digit numeric ids have larger range of 10 digits + 26 letters without losing uniqueness. need sort of hashing function maps smaller range larger range, guaranteeing one-to-one mapping unique ids guaranteed stay unique after being mapped.

i have searched , far have not found hashing or mapping functions guaranteed collision-free, 1 must exist if i'm mapping larger space. suggestions appreciated.

brandon staggs wrote article on implementing partial serial number verification system. examples written in delphi, converted other languages.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -