totp

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 3 Imported by: 0

README

totp

This library generates a TOTP for the given key at time t, in the manner commonly used by most websites (SHA1-based 6-digit code padded with 0s). The implementation is based on RFC 4226 and RFC 6238.

There's only one function, which generates the TOTP code for key at time t:

func TOTP(key []byte, t time.Time) string

I mainly wrote this because I wanted to see a bit more in depth how TOTP works. There are much more complete libraries out there.

Documentation

Overview

Package main contains an example of how to use totp.TOTP.

Directories

Path Synopsis
Package totp contains the function that generates a TOTP code.
Package totp contains the function that generates a TOTP code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL