I am writing a ruby uid generator and i need to generate unique ids in incremental order. The unique ids are strings that vary from 3 to 9 characters.
What i want to achieve is this:
Get the last generated identifier, convert it to bits, and 1 bit to it(basically do a + 1) and convert the result back to ascii. This way i can prevent a unique id from being generated twice.
How can i do this in ruby. I am aware of #pack and #unpack methods but i can't figure out a way.