
Facilitates encoding and decoding of data using various multibase schemes, including BASE10, BASE16, BASE32, BASE58, BASE64. Offers straightforward API functions for multibase string conversions and UVarInt operations.
This is combined a port of
This project includes the original Protocol Labs repository as a git submodule for its test vectors, but does not incorporate any code from it in releases.
multi2–base runs on all KMP targets except watchosDeviceArm64 and supports the following multibase encodings:
This library is available at maven central.
dependencies {
implementation("at.asitplus:multibase:$version")
}Note: This library exposes Matthew Nelson's Base64, Base32, and Base16 encoders as API dependency!
Simply MultiBase.decode(from_multibase_string) or MultiBase.encode(Base.<desired>, any_byte_array) to a multibase string
or use the extension functions:
multibaseString.multibaseDecode()byteArray.multibaseEncode(Base.<desired>)Note: Base10 and Base58 don't perform well. Only use those on small (<4KiB) data.
UVarInt works similarly straight-forward:
UVarInt(1337u)
someVarIntByteArray.varIntDecode() or UVarInt.fromByteArray(someVarIntByteArray)
aUVarInt.encodeToByteArray()
'Nuff said!
External contributions are greatly appreciated! Just be sure to observe the contribution guidelines (see CONTRIBUTING.md).
The MIT license does not apply to the project logo and the A-SIT logo, as these are the sole property of A-SIT/A-SIT Plus GmbH and may not be used without explicit permission!
This is combined a port of
This project includes the original Protocol Labs repository as a git submodule for its test vectors, but does not incorporate any code from it in releases.
multi2–base runs on all KMP targets except watchosDeviceArm64 and supports the following multibase encodings:
This library is available at maven central.
dependencies {
implementation("at.asitplus:multibase:$version")
}Note: This library exposes Matthew Nelson's Base64, Base32, and Base16 encoders as API dependency!
Simply MultiBase.decode(from_multibase_string) or MultiBase.encode(Base.<desired>, any_byte_array) to a multibase string
or use the extension functions:
multibaseString.multibaseDecode()byteArray.multibaseEncode(Base.<desired>)Note: Base10 and Base58 don't perform well. Only use those on small (<4KiB) data.
UVarInt works similarly straight-forward:
UVarInt(1337u)
someVarIntByteArray.varIntDecode() or UVarInt.fromByteArray(someVarIntByteArray)
aUVarInt.encodeToByteArray()
'Nuff said!
External contributions are greatly appreciated! Just be sure to observe the contribution guidelines (see CONTRIBUTING.md).
The MIT license does not apply to the project logo and the A-SIT logo, as these are the sole property of A-SIT/A-SIT Plus GmbH and may not be used without explicit permission!