No description, website, or topics provided.
Ruby C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ext/b62
lib
test
.gitignore
LICENSE
README.md
Rakefile
b62.gemspec

README.md

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)