Skip to main content

Crate braid58

Crate braid58 

Source
Expand description

Fixed-width Bitcoin Base58 for 32- and 64-byte values.

Braid58 is allocation-free. Cargo target features select the scalar, AVX2, or AVX-512 backend at compile time. The avx2 and avx512 features explicitly require those SIMD backends. Enabling either feature makes the resulting binary require the corresponding ISA.

let bytes = [42_u8; 32];
let encoded = braid58::encode_32(&bytes);
let decoded = braid58::decode_32(encoded.as_str())?;
assert_eq!(decoded, bytes);

let wide = [7_u8; 64];
let encoded = braid58::encode_64(&wide);
assert_eq!(braid58::decode_64(&encoded)?, wide);

Structs§

DecodeError
An invalid, overflowing, or noncanonical fixed-width Base58 value.
Encoded32
An encoded 32-byte value.
Encoded64
An encoded 64-byte value.

Constants§

BINARY_32_SIZE
The decoded width accepted and produced by the 32-byte API.
BINARY_64_SIZE
The decoded width accepted and produced by the 64-byte API.
BINARY_SIZE
The decoded width accepted and produced by the original 32-byte API.
MAX_ENCODED_32_LEN
The maximum encoded length of a 32-byte value.
MAX_ENCODED_64_LEN
The maximum encoded length of a 64-byte value.
MAX_ENCODED_LEN
The maximum encoded length of the original 32-byte API.

Functions§

decode_32
Decodes a canonical Bitcoin Base58 value into exactly 32 bytes.
decode_64
Decodes a canonical Bitcoin Base58 value into exactly 64 bytes.
decode_32_into
Decodes into an existing 32-byte buffer.
decode_64_into
Decodes into an existing 64-byte buffer.
encode_32
Encodes exactly 32 bytes with the Bitcoin Base58 alphabet.
encode_64
Encodes exactly 64 bytes with the Bitcoin Base58 alphabet.
encode_32x2
Encodes two independent 32-byte values through the fixed x2 entry point.
encode_32x3
Encodes three independent 32-byte values through the fixed x3 entry point.
encode_64x2
Encodes two independent 64-byte values through the fixed x2 entry point.
encode_64x3
Encodes three independent 64-byte values through the fixed x3 entry point.