base62.cr alternatives and similar shards
Based on the "Converters" category.
Alternatively, view base62.cr alternatives based on common mentions on social networks and blogs.
money6.4 0.0 base62.cr VS moneyCrystal shard for dealing with money and currency conversion
sass.cr6.1 0.0 base62.cr VS sass.crCompile Sass/SCSS to CSS in Crystal (libsass binding)
crunits3.4 0.0 base62.cr VS crunitsPhysical quantity and units of measure conversion and math for crystal lang
human_file_size.cr1.2 0.0 base62.cr VS human_file_size.crHuman File Size Converter, for JSON & YAML mappings - Crystal-Lang
time_format.cr1.2 0.0 base62.cr VS time_format.crConvert time in human readable format with ease
Access the most powerful time series database as a service
Do you think we are missing an alternative of base62.cr or a related project?
Crystal shard for Base62 encoding/decoding. It's especially useful for converting data into shortened strings suitable for URL shortening and/or obfuscating auto-incrementing resource ids from being exposed through RESTful APIs.
What is Base62 encoding?
Base62 encoding converts numbers to ASCII strings (0-9, a-z and A-Z) and vice versa, which typically results in comparatively short strings. Such identifiers also tend to be more readily identifiable by humans.
Add this to your application's
dependencies: base62: github: Sija/base62.cr
require "base62" Base62.encode(999) # => "G7" Base62.decode("G7") # => 999
This uses the default ASCII character set for encoding/decoding.
It's also possible to define a custom character set instead:
charset = "~9876543210ABCDEFGHIJKLMNOPQRSTU$#@%!abcdefghijklmnopqrstuvw-=" Base62.encode(999, charset) # => "F3" Base62.decode("F3", charset) # => 999
charset typically expects the respective string to contain
exactly 62 unique character. In fact, it's also possible to use characters
sets with more than 62 characters in order to achieve shorter identifiers
for large numbers.
- Fork it (https://github.com/Sija/base62.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
- @Sija Sijawusz Pur Rahnama - creator, maintainer
*Note that all licence references and agreements mentioned in the base62.cr README section above are relevant to that project's source code only.