zelark / nano-id-cc

Nano ID collision calculator
https://zelark.github.io/nano-id-cc/
MIT License
45 stars 10 forks source link

Computation should not depend on non-unique characters in the alphabet #12

Closed jt3k closed 6 years ago

jt3k commented 6 years ago

now a different result of the calculation if the alphabet "01" and "010"

zelark commented 6 years ago

If an alphabet contains non-unique characters, it's marked by red color. But such alphabet is correct as an input.

The calculator do a computation as long as it can. Thereby the result of the computation is consistent with its inputs.

now a different result of the calculation if the alphabet "01" and "010"

Actually, it will give you the same result but with different distribution of "0".

jt3k commented 6 years ago

All the same I see a mistake, because in the case of '010', the collision will happen no later than c '01', but the calculator tells us that the collision will happen later

zelark commented 6 years ago

but the calculator tells us that the collision will happen later

Oh, that's right. I think I'll fix it soon. Thanks.