Skip to content

vfiebig/totp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

totp

Simple GO TOTP compatible with Google Authenticator, based on RFC4226

https://godoc.org/github.com/vfiebig/totp

usage

package main

import (
	"encoding/base32"
	"github.com/vfiebig/totp"
)

func main() {
	totp_inst := totp.StdTOTP
	totp_inst.K, _ = base32.StdEncoding.DecodeString("BASE32SECRET")

	if _, ok := totp_inst.Validate(123456); ok {
		// Valid token
	} else {
		// Not a valid token
	}
}

About

Simple GO TOTP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages