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: 17 days ago
JSON representation
Constant-time hex and base64 codecs from libsodium reimplemented in Rust.
- Host: GitHub
- URL: https://github.com/jedisct1/rust-ct-codecs
- Owner: jedisct1
- License: mit
- Created: 2020-03-23T22:05:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-29T10:09:11.000Z (29 days ago)
- Last Synced: 2025-04-02T10:52:02.951Z (25 days ago)
- Topics: base64, codecs, constant-time, crypto, cryptography, hex, libhydrogen, libsodium, rust
- Language: Rust
- Size: 23.4 KB
- Stars: 14
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)?;
```