| Crates.io | totp_embed |
| lib.rs | totp_embed |
| version | 1.0.5 |
| created_at | 2022-05-17 16:23:01.44172+00 |
| updated_at | 2022-05-17 16:40:44.121017+00 |
| description | A fork of totp-lite for embedded environment. |
| homepage | https://github.com/M4tsuri/totp_embed |
| repository | https://github.com/M4tsuri/totp_embed |
| max_upload_size | |
| id | 588453 |
| size | 22,623 |
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