HackerTrans
トップ新着トレンドコメント過去質問紹介求人

dumbo-octopus

no profile record

コメント

dumbo-octopus
·2 年前·議論
I’d prefer it to be one that the developers have specifically targeted and developed/tested against, especially if there’s any GPU involvement.
dumbo-octopus
·3 年前·議論
There explicitly is no uniqueness guarantee. It is known that the same values can encode into many different strings, and they recommend always decoding then reencoding with a stable algorithm to achieve a "canonical" id if one is needed.

https://sqids.org/faq#valid-ids
dumbo-octopus
·3 年前·議論
But then why not just arbitrary text?
dumbo-octopus
·3 年前·議論
Odd design decision in that if you provide your own blocklist, it overwrites their (extensive) default list instead of adding to it.

And in general the algorithm is surprisingly complicated for something that could be replaced with simply base64 encoding, the given example (1,2,3) base64 encodes to a string with just one more letter than this algorithm.

That said I do appreciate the semicolon-free-style. I don't typically see that in libs besides my own.

https://github.com/sqids/sqids-javascript/blob/main/src/sqid...