Module encoding

Module encoding 

Source
Expand description

Encodings of binary data such as Base64 and Hex.

§Example

assert_eq!(Hex::encode("Hello world!"), "48656c6c6f20776f726c6421");
assert_eq!(Hex::encode_with_format("Hello world!"), "0x48656c6c6f20776f726c6421");
assert_eq!(Base64::encode("Hello world!"), "SGVsbG8gd29ybGQh");
assert_eq!(Base58::encode("Hello world!"), "2NEpo7TZRhna7vSvL");

Structs§

Base58
Base64
Base64 encoding
Bech32
Bech32 encoding
Hex
Hex string encoding.

Traits§

Encoding
Trait representing a general binary-to-string encoding.

Functions§

decode_bytes_hex
Decodes a hex string to bytes. Both upper and lower case characters are allowed in the hex string.