Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ratopi/base45
A Base45 encoder/decoder in pure Erlang
https://github.com/ratopi/base45
base45 erlang
Last synced: 1 day ago
JSON representation
A Base45 encoder/decoder in pure Erlang
- Host: GitHub
- URL: https://github.com/ratopi/base45
- Owner: ratopi
- License: apache-2.0
- Created: 2021-07-20T21:08:46.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-15T09:40:38.000Z (over 1 year ago)
- Last Synced: 2024-10-12T00:37:56.009Z (about 1 month ago)
- Topics: base45, erlang
- Language: Erlang
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base45
An Base45-encoder/decoder in pure Erlang.
Source code at https://github.com/ratopi/base45.Implementing encoding as defined in RFC 9285 (https://datatracker.ietf.org/doc/rfc9285/).
## Import to your project
Use it in your project via rebar dependency:
{deps, [base45]}.
or for a specific release:
{deps, [{base45, "2.0.0"]}.
Or if you like to fetch the source code from github:
{rebar, {git, "https://github.com/ratopi/base45.git", {tag, "2.0.0"}}}.
See https://hex.pm/packages/base45 for more info about the hex package.Overview of current releases are on the hex-page or at
https://github.com/ratopi/base45/releases.
## Usage
Usage is just straight forward.
Currently only binaries are supported.Encoding:
base45:encode(<<1,2,3>>).
gives
<<"X5030">>
Decoding:
base45:decode(<<"X5030">>).
gives
<<1,2,3>>
Calling decode with an illegal input string (like <<"GGW">>, which leads to 65536),
will throw an `illegal_encoding` exception in a tuple, containing the problematic part of the input:{illegal_encoding, <<"GGW">>}
Calling decode with an illegal input string with illegal base45 characters (that are characters not in
the base45 alphabet), will throw an `illegal_character` exception in a tuple, containing the problematic
part of the input:{illegal_character, <<"=">>}
## Feedback and bugs
Feel free to give me any feedback you like via github:
https://github.com/ratopi/base45/issues## Breaking changes
With version 2.0.0 the typo in error atom "illegale_encoding" was fixed, and is now "illegal_encoding" (w/o "e").