Expand description
Decoding traits for explicit string-to-bytes conversion.
Import paths:
use secure_gate::FromHexStr;etc. (notsecure_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_base32, 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:
| Trait | Feature |
|---|---|
FromHexStr | encoding-hex |
FromBase32Str | encoding-base32 |
FromBase64UrlStr | encoding-base64 |
FromBech32Str | encoding-bech32 |
FromBech32mStr | encoding-bech32 |
Re-exports§
pub use base32::FromBase32Str;allocandencoding-base32pub use base64_url::FromBase64UrlStr;allocandencoding-base64pub use bech32::FromBech32Str;allocandencoding-bech32pub use bech32m::FromBech32mStr;allocandencoding-bech32pub use hex::FromHexStr;allocandencoding-hex
Modules§
- base32
- Base32 decoding trait (RFC 4648 §6, uppercase, unpadded).
- base64_
url - URL-safe Base64 decoding trait.
- bech32
- Bech32 decoding trait.
- bech32m
encoding-bech32 - Bech32m decoding trait.
- hex
- Hexadecimal decoding trait.