Skip to main content

Module encoding

Module encoding 

Source
Expand description

Encoding traits for explicit secret-to-string conversion.

Import paths: use secure_gate::ToHex; etc. (not secure_gate::traits::encoding::hex::ToHex)

All encoding traits require alloc (they return String or EncodedSecret). Prefer zeroizing variants (*_zeroizing) when the encoded form is sensitive. See the decoding module for the reverse direction.

Each encoding trait has its own feature gate:

TraitFeature
ToHexencoding-hex
ToBase64Urlencoding-base64
ToBech32encoding-bech32
ToBech32mencoding-bech32m

Re-exports§

pub use base64_url::ToBase64Url;
pub use bech32::ToBech32;
pub use bech32m::ToBech32m;
pub use hex::ToHex;

Modules§

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