An encoder/decoder for base24 binary-to-text encoding for Ruby.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install base24
# Encode some bytes (bytes are strings) bytes = Random.new.bytes(4) str = Base24.encode24(bytes) decoded_bytes = Base24.decode24(str) decoded_bytes == bytes # is true Base24.encode24([0x88, 0x55, 0x33, 0x11].pack('C*')) == "5YEATXA" # is true
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.