package multibase
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b46509dd92fef15d2b78a4c831fa7c2caeef17e454f621711a2700dd82a15a95
sha512=28fcd03934e4de642bf1afaff9cb1e2563345b014601dcbb3e2bfefae8b88b2cda9c738e970bf339bd87bcab7b0b26cfc89bd71585a6ade00ac7ac0a7d92b504
Description
This library provides self-describing base encodings include Base32, Base58 and Base64
Added to opam-repository:
README
ocaml-multibase
A library providing self-identifying base encodings as per the multibase. Take the following encoded string. Not only can be decode it without specifying a base-encoding scheme, we also get that scheme back.
let encoded = "T9T1M2RBC41KN6837E9IM2T11"The Base.decode function will return either the encoding scheme along with the decoded string, or an error.
# Multibase.decode encoded;;
- : (Multibase.Encoding.t * string,
[ `Msg of string | `Unsupported of Multibase.Encoding.t ])
result
= Ok (`Base32hexpadupper, "OCaml is great!")So this string was encoded using Base32 with the extended hexadecimal alphabet in upper-case. We can just as easily put it back the way it was.
# let encoded_ = Multibase.encode `Base32hexpadupper "OCaml is great!";;
val encoded_ :
(string, [ `Msg of string | `Unsupported of Multibase.Encoding.t ]) result =
Ok "T9T1M2RBC41KN6837E9IM2T11"
# String.equal encoded (Result.get_ok encoded_);;
- : bool = trueNote that the main encode function will let you specify all possible encodings as per the specification. However, encode_t narrows this to the support encodings of this library, hence it won't return `` Unsupported.
# let encoded_ = Multibase.encode_t `Base32hexpadupper "OCaml is great!";;
val encoded_ : (string, [ `Msg of string ]) result =
Ok "T9T1M2RBC41KN6837E9IM2T11"
Optional Dependencies
None
Used by (1)
Conflicts
None
Build status
Results of building multibase with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.0 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure