xlzd / gotp

Golang OTP(One-Time Password) Library.
MIT License
468 stars 67 forks source link

add SetOtpDigit for change length of OTP generated #11

Closed oneleg closed 2 years ago

oneleg commented 2 years ago

Hi, I needed an otp with dynamic expireInterval length, so I added these functions (SetOtpDigit, SetOtpExpireInterval) I added them to the example file

mergenchik commented 2 years ago

Hi Alireza, thank you for your request. Sorry for late reply. Can you please refactor your code, so it will not use shared variables. There is already instance variable, OTP.digits and TOTP.interval, you can add extra constructor to change them.