Always decoding, even with random string
espindl opened this issue · comments
espindl commented
var sqids = new SqidsEncoder<long>(new SqidsOptions { Alphabet = _sqidAlphabet });
return sqids.Decode(sqid);
This code always decode, even with random string. But the playground returns Error: Invalid ID with the same string. Am I doing something wrong or missing a very primitive concept?
Ivan Akimov commented
Behind the scenes, the playground is simply doing id == encode(decode(id))
and if it's not equal, it'll output a user-friendly error.
More info: https://sqids.org/faq#valid-ids
Arad Alvand (AmirHossein Ahmadi) commented
espindl commented
Yeah, thank you and sorry I missed this in both faq and readme @aradalvand @4kimov