#codes #verification #stateless #generate #rotating #time-based #client

rotkeappchen

Crate for generating stateless and rotating verification codes

1 unstable release

0.1.0 Dec 30, 2023

#4 in #time-based

MIT license

7KB
111 lines

Rotkeappchen-rs

Crate for generating stateless and rotating verification codes, following the Rotkeappchen proposal.

Rotkeappchen verifies email addresses, CAPTCHA challenges, and timed access tokens.

Example

This crate generates time-based codes that are unique for each client:

use rotkeappchen::Rotkeappchen;

let rot = Rotkeappchen::default(b"secret", 60);  // 60 seconds
let code = rot.digest("client");

assert!(rot.is_valid("client", |digest| digest == code))

Dependencies

~1.5MB
~39K SLoC