Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jedisct1/rust-ct-codecs

Constant-time hex and base64 codecs from libsodium reimplemented in Rust.
https://github.com/jedisct1/rust-ct-codecs

base64 codecs constant-time crypto cryptography hex libhydrogen libsodium rust

Last synced: 1 day ago
JSON representation

Constant-time hex and base64 codecs from libsodium reimplemented in Rust.

Awesome Lists containing this project

README

        

# 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.

Links:

- [crates.io page](https://crates.io/crates/ct-codecs)
- [docs.rs page](https://docs.rs/ct-codecs)

## Example usage

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

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