Edge Slice Rerendering (ESR), React, compilers, RxJS core team alum, WebAssembly, Co-founder @OutsmartlyHQ, prev eng at @Netflix

Joined April 2009
Jay Phelps retweeted
72
2,465
25,672
Smokin these meats
6
0
28
Looking for the best algo to generate an ID that: - Is as short as possible - Aside from random number, requires no other input (no counters, lookups, machine details, etc) so cannot look up previous - Collisions only bad if they are sequential (generated twice in a row)
8
0
13
Two IDs could be generated on the same/different machine, different machines, same/different time, etc. I can't think of any way for the sequential collision requirement property to help, without the previous input/state, but maybe you algo folks have voodoo magic
1
0
0
Addendum: - Sequentially generation is guaranteed to happen at least 1 seconds apart, globally. Which is probably a helpful property since that means time might be able to be used as part of the input after all, not just random()?
3
0
1
OK it's not actually "guaranteed" but for practical purposes in this use case it's extremely unlikely sequential generation to happen within 1 second and even less likely that if they were identical IDs that it would matter--it should, in practice, be totally fine in this case.
1
0
1
The big reason I'm asking here is the "short as possible" desire. These are going to be commonly seen and typed, so length affects UX.
2
0
1