Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 565 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 565 Bytes

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)