123
This commit is contained in:
@@ -77,6 +77,14 @@ type ValidateOpts struct {
|
||||
Encoder otp.Encoder
|
||||
}
|
||||
|
||||
func (opts *ValidateOpts) ConvertToValidateOpts(generateOpts GenerateOpts) {
|
||||
opts.Period = generateOpts.Period
|
||||
opts.Skew = 1
|
||||
opts.Digits = generateOpts.Digits
|
||||
opts.Algorithm = generateOpts.Algorithm
|
||||
opts.Encoder = otp.EncoderDefault
|
||||
}
|
||||
|
||||
// GenerateCodeCustom takes a timepoint and produces a passcode using a
|
||||
// secret and the provided opts. (Under the hood, this is making an adapted
|
||||
// call to hcmii-uav-watchdog-otp.GenerateCodeCustom)
|
||||
|
||||
Reference in New Issue
Block a user