Skip to content

Base transcoder (Base62, Base58, BaseN) with multibyte character alphabet support.

License

Notifications You must be signed in to change notification settings

radbas/multibase.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multibase.cr

Base transcoder for Base62, Base58, Base85 (RFC 1924), BaseN with multibyte character alphabet support. This library performs byte by byte transcodings and is not compatible with RFC 4648.

Do not use for Base16, Base32, Base64 or basE91

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      multibase:
        github: radbas/multibase
  2. Run shards install

Usage

require "multibase"

base62 = Multibase::Base62.encode("Hello World")
p base62 # 73XpUgyMwkGr29M

decoded = Multibase::Base62.decode("73XpUgyMwkGr29M")
p String.new(decoded) # Hello World

# custom transcoder
transcoder = Multibase::Transcoder.new("123456789custom")

# transcoder.encode()
# transcoder.decode()

Contributing

  1. Fork it (https://github.com/radbas/multibase/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 a new Pull Request

Contributors

About

Base transcoder (Base62, Base58, BaseN) with multibyte character alphabet support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published