I am thinking of using hash IDs in one of my projects.
However, the IDs must be case insensitive (all lower case). So, I was thinking of adding digit(s) (0-F) at the end after a period(.) or hyphen(-).
The number of digits will depend on length of ID and bits in digit will represent positions of capital letters in ID.
For example, if the ID generated is:
0R9ty3En
We need 8 bits to represent 8 chars. And, positions (assuming 'n' is at 0) 1 and 6 are capital. Hence, we need: 01000010
which in hex translates to: 42.
So, complete hex id would now be: 0r9ty3en-42 (all lower case that can be translated back to original easily).
I am thinking of using hash IDs in one of my projects.
However, the IDs must be case insensitive (all lower case). So, I was thinking of adding digit(s) (0-F) at the end after a period(.) or hyphen(-).
The number of digits will depend on length of ID and bits in digit will represent positions of capital letters in ID.
For example, if the ID generated is: 0R9ty3En We need 8 bits to represent 8 chars. And, positions (assuming 'n' is at 0) 1 and 6 are capital. Hence, we need: 01000010
which in hex translates to: 42.
So, complete hex id would now be: 0r9ty3en-42 (all lower case that can be translated back to original easily).
Is there a better way to do this?