Instance Method
generate(counter:range:)
Generates several HOTP’s for a range.
func generate(counter: UInt64, range: Int) -> [String]
Parameters
counterThe ‘main’ counter.
rangeThe number of codes to generate in both the forward and backward direction. This number must be bigger than 0. For example, if
rangeis2, a total of5codes will be returned: The main code, the two codes prior to the main code and the two codes after the main code.
Return Value
All the generated OTP’s in an array.
Discussion
Note
This function will automatically wrap the counter by using integer overflow.