3 releases

0.0.10 Aug 19, 2023
0.0.5 Aug 19, 2023
0.0.4 Aug 19, 2023

#24 in #decode-base64

Download history 8/week @ 2024-07-26 24/week @ 2024-08-02 162/week @ 2024-08-09 22/week @ 2024-08-16 2/week @ 2024-08-23 32/week @ 2024-08-30 13/week @ 2024-09-06 42/week @ 2024-09-20 11/week @ 2024-09-27 3/week @ 2024-10-04 11/week @ 2024-10-11 20/week @ 2024-10-18 94/week @ 2024-10-25 27/week @ 2024-11-01

152 downloads per month
Used in 2 crates (via i18)

BSL-1.0 license

10KB
162 lines

ub64 : urlsafe base64 encode / decode

→ tests/main.rs

use ub64::{b64_u64, b64d, b64e, u64_b64};

#[test]
fn main() {
  let bin = [1, 2, 3];
  let b64 = b64e(bin);
  dbg!(&b64);
  dbg!(b64d(b64).unwrap());
  let n = 9876543210;
  let u64_b64 = u64_b64(n);
  dbg!(&u64_b64);
  dbg!(b64_u64(u64_b64));
}

run

→ out.txt

+ cargo test --all-features -- --nocapture
     Running tests/main.rs (target/debug/deps/main-8af48d1761c45bbe)
[tests/main.rs:7] &b64 = "AQID"
[tests/main.rs:8] b64d(b64).unwrap() = [
    1,
    2,
    3,
]
[tests/main.rs:11] &u64_b64 = "6hawTAI"
[tests/main.rs:12] b64_u64(u64_b64) = 9876543210

Dependencies

~235KB