Expand description
Encoding traits for explicit secret-to-string conversion.
Import paths:
use secure_gate::ToHex;etc. (notsecure_gate::traits::encoding::hex::ToHex)
All encoding traits require alloc. Every encoder returns
EncodedSecret: the encoded form is a second full copy of
the secret, and it stays wiped until it drops.
See the decoding module for the reverse direction.
Each encoding trait has its own feature gate:
| Trait | Feature |
|---|---|
ToHex | encoding-hex |
ToBase32 | encoding-base32 |
ToBase64Url | encoding-base64 |
ToBech32 | encoding-bech32 |
ToBech32m | encoding-bech32 |
Re-exports§
pub use self::bech32::ToBech32;pub use self::bech32::bech32_code_length;pub use self::bech32::Bech32Sized;pub use self::bech32::Bech32Standard;pub use self::bech32::BECH32_CODE_LENGTH;pub use base32::ToBase32;pub use base64_url::ToBase64Url;pub use bech32m::ToBech32m;pub use bech32m::Bech32mSized;pub use bech32m::Bech32mStandard;pub use hex::ToHex;
Modules§
- base32
- Base32 encoding trait (RFC 4648 §6, uppercase, unpadded).
- base64_
url - URL-safe Base64 encoding trait.
- bech32
- Bech32 encoding trait.
- bech32m
- Bech32m encoding trait.
- hex
- Hexadecimal encoding trait.
Enums§
- Case
- Which case an encoder should emit.
Traits§
- Encodable
Bytes - Marker for types that may be encoded: byte-shaped sources.