Campbell Ritchie wrote:How can you be sure the numbers will be unique?
shehzaad goonoo wrote:The number will be stored on database and later used to retrieve the actual record it was derived from.
shehzaad goonoo wrote:I tried using a hash (md5, sha-1) of the primary key, but this generates 32-character long hex strings.
shehzaad goonoo wrote:1) I need to keep the length of the reference to a minimum, so that the "barcode lines" generated are also a minimum. (I am using code-39)
I tried using a hash (md5, sha-1) of the primary key, but this generates 32-character long hex strings.
shehzaad goonoo wrote:1. as input, I have a table's primary key
2. as output, I want another unique number (It is not a requirement for it to be based on the primary key or not, as long as it stays unique across the rows of the table) of a reasonable length, say 16 digits max.
3. It has to be a Java solution.