Project

b62

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Adds a to_b62 function to the Integer class that encodes any integer between 0 and 18446744073709551615 to base 62. The encode function is implemented as a C extension so it's much faster than a plain ruby implementation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

b62

Dead simple lightning fast base 62 (only) encoder based on the yab62 gem by Teng Siong Ong. Right now there are only few improvements over yab62:

  • Index table modified to 0-9|A-Z|a-z instead of 0-9|a-z|A-Z
  • Can encode integers bigger than 839299365868340352
  • Slightly faster on some environments

Overview

Adds a to_b62 function to the Integer class that encodes any integer between 0 and 18446744073709551615 to base 62. The encode function is implemented as a C extension so it's much faster than a plain ruby implementation.

Install

gem install b62

Or add it to your Gemfile as well:

gem 'b62', '~> 1.0'

## Use

82310.to_b62
B62.to_b62(2377965395771)