FAQ
Hi all,

I've just pushed my Go implementation of TOTP, as used with Google
Validator. I pronounce it 'Goto Teepee'.

Get it here: http://www.github.com/craigmj/gototp

Or import:

go get github.com/craigmj/gototp

A simple implementation:

---
package main

import (
     "fmt"
     "math/rand"
     "time"

     "github.com/craigmj/gototp"
)

func main() {
     rnd := rand.New(rand.NewSource(time.Now().Unix()))
     secret := gototp.RandomSecret(10, rnd)
     otp, err := gototp.New(secret)
     if nil != err {
         panic(err)
     }
     fmt.Println("Code is ", otp.Now())
     fmt.Println("URL is ", otp.QRCodeGoogleChartsUrl("Hi there", 300))
}
---

Sorry, no tests yet - am working on some of those.

Hope people find it useful!

All the best,
Craig

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 10, '13 at 1:42a
activeMay 10, '13 at 1:42a
posts1
users1
websitegolang.org

1 user in discussion

Craig Mason-Jones: 1 post

People

Translate

site design / logo © 2021 Grokbase