TOTP

Index

totp/check totp/generate totp/new

Reference

totp/checkcfunction
(totp/check totp code &opt timestamp acceptable-drift)

Return true if the provided OTP `code` is correct for the provided `timestamp`. If required, use clock `acceptable-drift` to deal with the client and server having slightly different clocks. If omitted, current timestamp is used for `timestamp` and the default value for `acceptable-drift` is 0.

totp/generatecfunction
(totp/generate totp &opt timestamp)

Generate an TOTP code for the provided `timestamp`. If omitted, current timestamp is used.

totp/newcfunction
(totp/new key &opt hash digits timestep)

Instantiate a new TOTP instance with the given parameters. If omitted, the default value for `hash` is "SHA-1", the default value for `digits` is 6 and the default value for `timestep` is 30.