I am facing the need to reinvent the wheel because I also need some kind of short uuid, like amazon ASIN, generated using internal company id , user id, product id, and a second-based time stamp. But I'd like to find an algorithm to make them looks incrementals. for example, Amazon's ASIN are progressive, every new created one is comparable/sortable as greater of previous one created, but they are not a simple counter. I think I will use second-based unix-time as first part, then appending some internals id MODding each one by 4096 to keep it shorty and then rebasing obtained nubmer into base 36 (to use 26 uppercase letters plus numerbers from 0 to 9).
I am Googling since a few hours to lookup for suggersions or pre-made solutions.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am facing the need to reinvent the wheel because I also need some kind of short uuid, like amazon ASIN, generated using internal company id , user id, product id, and a second-based time stamp. But I'd like to find an algorithm to make them looks incrementals. for example, Amazon's ASIN are progressive, every new created one is comparable/sortable as greater of previous one created, but they are not a simple counter. I think I will use second-based unix-time as first part, then appending some internals id MODding each one by 4096 to keep it shorty and then rebasing obtained nubmer into base 36 (to use 26 uppercase letters plus numerbers from 0 to 9).
I am Googling since a few hours to lookup for suggersions or pre-made solutions.