blob: ccfe63588bec14141c2c492e1e8def79b01c5191 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# 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](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)?;
```
|