/otp2go

Minimal OTP library for Go

Primary LanguageGoBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

otp2go

Version License

Simple OTP library for Go

License: BSD-3-Clause

Usage

At a glance

// ...
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)