File: README.md

package info (click to toggle)
ruby-base62 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 120 kB
  • sloc: ruby: 93; makefile: 3
file content (37 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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

```bash
$ gem install base62
```

## Usage

```ruby
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

* [Lasse Bunk](https://github.com/lassebunk) for totally refactoring everything and bringing it into the modern age.
* [Saadiq Rodgers-King](http://github.com/saadiq) for making it work with Ruby 1.9.
* [Derrick Camerino](https://github.com/robustdj) for adding a Gemspec and prompting me to clean stuff up.

Copyright (c) 2008-2014 [JT Zemp](https://github.com/jtzemp), released under the [MIT License](https://github.com/jtzemp/base62/blob/master/LICENSE.txt)