Code Monkey home page Code Monkey logo

b3bm's Introduction

b3bm

Base62 for Ruby.

This library offers Base62 encoding/decoding using a methodology that is generally compatible with encodings from other ecosystems. Unfortunately the approach is very inefficient. Just how inefficient is it? Well, here's a comparison between b3bm, base_x, and Ruby's url-safe Base64 encoder:

$ bundle exec ruby benchmarks/decode.rb
Warming up --------------------------------------
                b3bm   105.000  i/100ms
              base_x    97.000  i/100ms
              base64    40.921k i/100ms
Calculating -------------------------------------
                b3bm      1.079k (± 6.8%) i/s -      5.460k in   5.089545s
              base_x    951.151  (± 4.9%) i/s -      4.753k in   5.010191s
              base64    372.882k (±11.9%) i/s -      1.841M in   5.016939s

Comparison:
              base64:   372881.6 i/s
                b3bm:     1078.9 i/s - 345.61x  (± 0.00) slower
              base_x:      951.2 i/s - 392.03x  (± 0.00) slower

Use b3e if you care about performance more than portability.

b3bm's People

Contributors

bryanp avatar commit-tools-bot avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.