pquerna / otp

TOTP library for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace strings.TrimRight with base32.NoPadding

opened this issue · comments

In totp.Generate() there is
v.Set("secret", strings.TrimRight(base32.StdEncoding.EncodeToString(secret), "="))
to remove the "=" used for padding. Instead of trimming the result, the following should be used:
base32.StdEncoding.WithPadding(base32.NoPadding).EncodeToString(secret))