crystal-uvarint
crystal-uvarint
crystal-uvarint
is an unsigned varint implementation in Crystal. The implementation is based on varint.go.
Installation
Add this to your application's shard.yml
:
dependencies:
uvarint:
github: freitagbr/crystal-uvarint
Usage
require "uvarint"
e = UVarint.encode 300_u64
#=> e == [172_u8, 2_u8]
d = UVarint.decode e
#=> d == 300_u64
Use UVarint.encode
to encode a UInt64
to a varint, which is an Array(UInt8)
(basically, an array of bytes).
Use UVarint.decode
to decode a varint to a UInt64
.
Development
Create an issue or submit a PR. Be sure to add tests if need be.
Contributing
- Fork it ( https://github.com/freitagbr/crystal-uvarint/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
Repository
crystal-uvarint
Owner
Statistic
- 2
- 0
- 1
- 2
- 0
- over 7 years ago
- March 2, 2017
License
MIT License
Links
Synced at
Sat, 21 Dec 2024 17:01:03 GMT
Languages