rust-auth-utils 1.0.0

A rust port of @better-auth/utils.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::binary::{Binary, EncodingType};

#[test]
fn test_encode_decode_utf8() {
    let text = "Hello, World!";
    let encoded = Binary::encode(text);
    let decoded = Binary::decode(&encoded, EncodingType::Utf8);
    assert_eq!(text, decoded);
}

#[test]
fn test_encode_decode_iso885910() {
    let text = "Hello, World!";
    let encoded = Binary::encode_with(text, EncodingType::Iso885910);
    let decoded = Binary::decode(&encoded, EncodingType::Iso885910);
    assert_eq!(text, decoded);
}