Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

planas/b62

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published