sec51 / twofactor

Golang two factor authentication library
ISC License
217 stars 66 forks source link

undefined: crypto #19

Closed syedJunaidd closed 5 years ago

syedJunaidd commented 5 years ago

while instantiating the TOTP object via: otp, err := twofactor.NewTOTP("info@sec51.com", "Sec51", crypto.SHA1, 8)
if err != nil { fmt.Println(err) }

i got this error: .\main.go:8:60: undefined: crypto

this is my go file:

package main

import "fmt" import "github.com/sec51/twofactor"

func main(){ fmt.Println("ds") otp, err := twofactor.NewTOTP("info@sec51.com", "Sec51", crypto.SHA1, 8) if err != nil { fmt.Println(err) }

qrBytes, err := otp.QR() if err != nil { fmt.Println(err) }

}

I am newbee to golang and authentication process so may be i am missing any dependency here. Thanks.

syedJunaidd commented 5 years ago

Sorry my bad, I think i was not importing go "crypto" package.