tree: 7b7e256a1d6c01cdc9cb163022779dd9f2114d74 [path history] [tgz]
  1. src/
  2. .cargo-checksum.json
  3. Cargo.toml
  4. LICENSE
  5. README.md
vendor/ct-codecs-1.1.1/README.md

CT-Codecs

A reimplementation of the base64 and hexadecimal codecs from libsodium and libhydrogen in Rust.

  • Constant-time for a given length, suitable for cryptographic purposes
  • Strict (base64 strings are not malleable)
  • Supports padded and unpadded, original and URL-safe base64 variants
  • Supports characters to be ignored by the decoder
  • Zero dependencies, no_std friendly.

API documentation

Example usage

use ct_codecs::{Base64UrlSafe, Decoder, Encoder};

let encoded = Base64UrlSafe::encode_to_string(x)?;
let decoded = Base64UrlSafe::decode_to_vec(encoded, None)?;