Sha256: fa8afa2600c31567e5643c543e598e763bc375c41b35e665cea28d1089341fbd

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

# Fossyl

Pre-historic Bencoding

## Installation

Add this line to your application's Gemfile:

    gem 'fossyl'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install fossyl

## Usage

```ruby
require "fossyl"

# Encoding
Fossyl.dump("strings")                  # => "7:strings"
Fossyl.dump(12)                         # => "i12e"
Fossyl.dump([1, "two", 3])              # => "li1e3:twoi3ee"
Fossyl.dump(a: 1, b: "two", c: [1])     # => "d1:ai1e1:b3:two1:cli1eee"

# Decoding
Fossyl.load("7:strings")                # => "strings"
Fossyl.load("i12e")                     # => 12
Fossyl.load("li1e3:twoi3ee")            # => [1, "two", 3]
Fossyl.load("d1:ai1e1:b3:two1:cli1eee") # => { "a" => 1, "b" => "two", "c" => [1] }
```

## Contributing

1. Fork it
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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fossyl-0.5.0 README.md