https://github.com/iaintshine/shortener
A Ruby library used for manufacturing the flic.kr style base58 shortened URLs
https://github.com/iaintshine/shortener
Last synced: 3 months ago
JSON representation
A Ruby library used for manufacturing the flic.kr style base58 shortened URLs
- Host: GitHub
- URL: https://github.com/iaintshine/shortener
- Owner: iaintshine
- License: mit
- Created: 2014-08-13T10:37:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-13T10:42:48.000Z (almost 11 years ago)
- Last Synced: 2025-02-04T14:48:27.306Z (4 months ago)
- Language: Ruby
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Shortener
A Ruby library used for manufacturing the flic.kr style base58 shortened URLs.
See this blog post [manufacturing flic.kr style photo URLs](https://www.flickr.com/groups/api/discuss/72157616713786392/)
## Installation
Add this line to your application's Gemfile:
gem 'shortener', :git => 'https://github.com/iaintshine/shortener.git'
And then execute:
$ bundle
Or install it yourself as:
$ gem install shortener
## Usage
Create an instance of a shortener
```ruby
s = Shortener.new
```### Encoding
```ruby
hash = s.encode 100 # => "2J"
```### Deconding
```ruby
num = s.decode "2J" # => 100
```## Contributing
1. Fork it ( http://github.com//shortener/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request