Skip to main content

Module decoding

Module decoding 

Source
Expand description

Decoding traits for explicit string-to-bytes conversion.

Import paths: use secure_gate::FromHexStr; etc. (not secure_gate::traits::decoding::hex::FromHexStr)

All decoding traits return Vec<u8> (require alloc). For no-alloc targets, use Fixed::try_from_hex, Fixed::try_from_base64url, etc. — these decode directly into a stack-allocated buffer. Treat all input as untrusted. Prefer HRP-validated bech32 methods. See the encoding module for the reverse direction.

Each decoding trait has its own feature gate:

TraitFeature
FromHexStrencoding-hex
FromBase64UrlStrencoding-base64
FromBech32Strencoding-bech32
FromBech32mStrencoding-bech32m

Re-exports§

pub use base64_url::FromBase64UrlStr;
pub use bech32::FromBech32Str;
pub use bech32m::FromBech32mStr;
pub use hex::FromHexStr;

Modules§

base64_url
URL-safe Base64 decoding trait.
bech32
Bech32 decoding trait.
bech32m
Bech32m decoding trait.
hex
Hexadecimal decoding trait.