TOTP (RFC-6238) implementation in Go with no external dependencies.
You can do little copying the totp.go
file or add this package as Go module dependency as follows (version pinning is highly encouraged):
go get -u -v github.com/simukti/totp
See totp_test.go.
- Shared-secret (
key
) parameter is in[]byte
and will be used as-is, the implementor should handle its encoding/decoding as needed. - It will only provide the code at the given time period counter only, no time skew mechanism.
- See Security Considerations in the official RFC.