base64-ng-bytes 1.2.0

Optional bytes::Buf and Bytes helpers for base64-ng
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# base64-ng-bytes

Optional `bytes` integration for `base64-ng`.

This companion crate provides explicit helpers for services that already use
`bytes::Bytes`, `bytes::BytesMut`, `bytes::Buf`, and `bytes::BufMut`.

```rust
use base64_ng::STANDARD;
use base64_ng_bytes::EngineBytesExt;

let encoded = STANDARD.encode_bytes(b"hello").unwrap();
assert_eq!(&encoded[..], b"aGVsbG8=");

let decoded = STANDARD.decode_bytes(encoded).unwrap();
assert_eq!(&decoded[..], b"hello");
```