sqids / sqids-javascript

Official JavaScript port of Sqids. Generate short unique IDs from numbers.
https://sqids.org/javascript
MIT License
679 stars 14 forks source link

How to check Error: Invalid ID like "https://sqids.org/playground" #26

Closed amarezenebe closed 6 months ago

amarezenebe commented 7 months ago

i try to check if i change some value still i will get result or not for example const sqids = new Sqids({ alphabet: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', minLength:11 });

// encode sqids.encode([1]) 'UkLWZg9DAJQ' // decode sqids.decode('UkLWZg9DAJQ') image


// the problem is when i change value from 'UkLWZg9DAJQ' to akLWZg9DAJQ still i will get value sqids.decode('akLWZg9DAJQ')=>[368240725753862300] BUT when i try it akLWZg9DAJQ with playground,"https://sqids.org/playground" it's give me Error: Invalid ID how can i do like playground image

4kimov commented 6 months ago

https://sqids.org/faq#valid-ids