base64id 0.4.1

Efficiently represent 64, 32 and 16 bit integers as base64url strings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use base64id::{Base64Id, Error};
use std::str::FromStr;

#[derive(Base64Id)]
struct MyId(i64);

fn main() -> Result<(), Error> {
    let id_str = MyId::from_str("PDFehCFVGqA")?;
    let id_int = i64::from(id_str);

    println!("{}", id_int); // 4337351837722417824

    Ok(())
}