Introducing Sqids Crystal

, posted

In an effort to blog about more of my random projects, today I’m announcing my port of Sqids to the Crystal programming language.

Sqids is a simple encoding for a list of numbers. For example, [123, 456] gets encoded as B9fj0X. I didn’t create this project, but I thought it was neat.

Sqids Crystal, as the name suggests, is a Crystal library for encoding and decoding Sqids. This is the thing I made!

Because Crystal is so similar to Ruby, it was a small effort to port Sqids Ruby to Crystal. For the most part, I was able to copy-paste the code and make some small changes:

Porting this code from Ruby to Crystal was as easy as 1, 2, 3…or should I say 86Rf07.

It was a fun little project!