Giter Club home page Giter Club logo

base62's Introduction

Build Status

Base62

Base62 monkeypatches Integer to add an Integer#base62_encode instance method to encode an integer in the character set of 0-9 + A-Z + a-z. It also monkeypatches String to add String#base62_decode to take the string and turn it back into a valid integer.

Installation

$ gem install base62

Usage

require 'base62'

123.base62_encode
# => "1z"

"funky".base62_decode
# => 619367412

Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new pull request

Thanks

Copyright (c) 2008-2014 JT Zemp, released under the MIT License

base62's People

Contributors

jtzemp avatar lassebunk avatar saadiq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

base62's Issues

Drop support for Ruby 1.8?

Sorry for all these issues, I just wanted to ask if we can drop support for Ruby 1.8 as this is no longer officially supported? This would enable some shortcuts in the code.

Why does this convert to lowercase?

I just lost so much time because it seems either this library, or my partners php base62 library is behaving very unexpectedly.

This one converts 10008287 to fzbz and his converts it to FZBZ.

I checked another base62 gem for sanity... this one: https://github.com/steventen/base62-rb

And it also does it as FZBZ. Every other library I've tried thus far uses uppercase.

Do you know why this is? I thought there was only 1 kind of base62, without any room for variation?

Doesn't work in MRI 2.1.0

Not sure what the issue is: It doesn't seem to find the gem. require nor the monkey-patched code works.

Separating the String and Integer extensions

@jtzemp, I'd like to move the String and Integer extensions to a separate require, so you can do require "base62/ext" if you need the patches.

This is to enable using the gem in other gems without monkey-patching the using projects.

Thoughts?

Enabling Travis-CI

Hi @jtzemp,

I have prepared the project for Travis-CI to enable automated testing of the supported Ruby versions and new incoming pull requests.

Could you go to https://travis-ci.org/profile/jtzemp and flick the On switch for the project. This enables hooks for Travis-CI when we push to the GitHub repo.

Thanks.

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.