Simple OTP library for Go
License: BSD-3-Clause
// ...
import (
"fmt"
"crypto"
_ "crypto/sha1"
otp "github.com/chardon55/otp2go"
)
// ...
totp, err := otp.NewTOTPBase32("<Your Base32 secret>", crypto.SHA1)
// check error
password, remainTime := totp.GenerateString6()
fmt.Printf("Password: %s, remaining seconds: %d", password, remainTime)