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_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 |
FromBase64UrlStr | encoding-base64 |
FromBech32Str | encoding-bech32 |
FromBech32mStr | encoding-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.