totp_embed

Crates.iototp_embed
lib.rstotp_embed
version1.0.5
sourcesrc
created_at2022-05-17 16:23:01.44172
updated_at2022-05-17 16:40:44.121017
descriptionA fork of totp-lite for embedded environment.
homepagehttps://github.com/M4tsuri/totp_embed
repositoryhttps://github.com/M4tsuri/totp_embed
max_upload_size
id588453
size22,623
M4tsuri (M4tsuri)

documentation

README

Workflow Status

totp_embed

This is a fork of original totp-lite with some changes on API and added support for no_std.

fn totp1_tests() {
    let secret: &[u8] = b"12345678901234567890";
    assert_eq!(20, secret.len());
    let pairs = vec![
        (94287082, 59),
        (07081804, 1111111109),
        (14050471, 1111111111),
        (89005924, 1234567890),
        (69279037, 2000000000),
        (65353130, 20000000000),
    ];
    
    pairs.into_iter().for_each(|(expected, time)| {
        assert_eq!(expected, totp::<Sha1>(secret, time));
    });
}

See totp-lite for more details.

License: MIT

Commit count: 53

cargo fmt