idmix Library Offers Type-Safe, Non-Deterministic Alternative to Sqids for API Keys
A developer has released idmix, an open-source short ID encoding library designed to address key limitations of the widely used Sqids library. Unlike Sqids, idmix supports negative integers, preserves original data types during encoding and decoding, and produces different output strings for the same input on each call, reducing vulnerability to scanning attacks. The library also includes a built-in 2-bit XOR checksum that catches roughly 75% of random tampering attempts without extra storage. Benchmarks cited by the author claim idmix encodes up to 47 times faster than Sqids in Go and 12 times faster in Rust. Consistent implementations are available across nine languages including Go, Rust, Python, JavaScript, Java, C#, PHP, C++, and C, allowing cross-language encode-decode compatibility.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in