https://github.com/jamescook/b32
Base32 encoder/decoder
https://github.com/jamescook/b32
base32 c ruby
Last synced: 3 months ago
JSON representation
Base32 encoder/decoder
- Host: GitHub
- URL: https://github.com/jamescook/b32
- Owner: jamescook
- License: mit
- Created: 2019-04-24T00:51:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-07T16:52:49.000Z (over 5 years ago)
- Last Synced: 2025-05-07T21:33:58.043Z (5 months ago)
- Topics: base32, c, ruby
- Language: C
- Size: 11.7 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Base32 Encoder/Decoder

B32 is a Ruby native extension that wraps the base32 library found
in [tpmtotop](https://github.com/mjg59/tpmtotp/blob/master/base32.h)### Usage
```ruby
require 'b32'
encoded = B32.encode('My string')
decoded = B32.decode(encoded)
```### Benchmark
From Core i7 Macbook Pro (2014). Ruby 2.5.3
```
user system total real
base32 pure ruby (encode) 1.348343 0.000489 1.348832 ( 1.349179)
base32 c extension (encode) 0.001638 0.000002 0.001640 ( 0.001629)
base32 pure ruby (decode) 1.334840 0.000574 1.335414 ( 1.335513)
base32 c extension (decode) 0.003613 0.000331 0.003944 ( 0.003933)
```### Requirements
* Ruby 2.2+
* gcc/clang### Developing
Simply make your changes and re-run the tests. Compilation is automatic.
```
rake test
```### License
MIT