bson 3.0.0

Encoding and decoding support for BSON in Rust
Documentation
1
2
3
4
5
6
7
8
9
use base64::{engine::general_purpose::STANDARD, DecodeError, Engine};

pub fn decode<T: AsRef<[u8]>>(input: T) -> Result<Vec<u8>, DecodeError> {
    STANDARD.decode(input)
}

pub fn encode<T: AsRef<[u8]>>(input: T) -> String {
    STANDARD.encode(input)
}