☰
Index
Modules:
twofa
,
twofa/base32
,
twofa/otp
.
API symbols
algSHA1:
otp: OTPAlgorithm.algSHA1
algSHA512:
otp: OTPAlgorithm.algSHA512
at:
otp: proc at(self: HOTP; counter: int): int
otp: proc at(self: TOTP; timestamp: int): int
AuthURI:
twofa: type AuthURI
Base32Error:
base32: object Base32Error
decode:
base32: proc decode(s: openArray[char]): string
defaultDigits:
otp: const defaultDigits
defaultInterval:
otp: const defaultInterval
defaultWindow:
otp: const defaultWindow
encode:
base32: proc encode(s: openArray[char]; pad = true): string
generateCode:
otp: proc generateCode(secret: string; input: int; digits: OTPDigits; algorithm: OTPAlgorithm): int
genHotpUri:
twofa: proc genHotpUri(secret: string; label: string; issuer = ""; counter = 0; digits: OTPDigits = defaultDigits; algorithm: OTPAlgorithm = algSHA1): string
genTotpUri:
twofa: proc genTotpUri(secret: string; label: string; issuer = ""; interval = defaultInterval; digits: OTPDigits = defaultDigits; algorithm: OTPAlgorithm = algSHA1): string
getQr:
twofa: proc getQr(uri: AuthURI; scale = 8; border = 4; dark = "#000000"; light = "#ffffff"; options = defaultQrEncodeOptions()): string
HOTP:
otp: object HOTP
initHotp:
otp: proc initHotp(secret: openArray[char]; digits: OTPDigits = defaultDigits; algorithm: OTPAlgorithm = algSHA1; issuer: string = ""; accountName: string = ""; counter: int = 0): HOTP
otp: proc initHotp(secret: static openArray[char]; digits: OTPDigits = defaultDigits; algorithm: OTPAlgorithm = algSHA1; issuer: string = ""; accountName: string = ""; counter: int = 0): HOTP
initTotp:
otp: proc initTotp(secret: openArray[char]; digits: OTPDigits = defaultDigits; interval: int = defaultInterval; algorithm: OTPAlgorithm = algSHA1; issuer: string = ""; accountName: string = ""): TOTP
otp: proc initTotp(secret: static openArray[char]; digits: OTPDigits = defaultDigits; interval: int = defaultInterval; algorithm: OTPAlgorithm = algSHA1; issuer: string = ""; accountName: string = ""): TOTP
next:
otp: proc next(self: var HOTP): int
now:
otp: proc now(self: TOTP): int
OTPAlgorithm:
otp: enum OTPAlgorithm
OTPDefect:
otp: object OTPDefect
OTPDigits:
otp: type OTPDigits
OTPError:
otp: object OTPError
provisioningUri:
otp: proc provisioningUri(self: HOTP; initialCount: int = 0): string
otp: proc provisioningUri(self: TOTP): string
saveMatrix:
twofa: proc saveMatrix(m: QrMatrix; path: string; scale = 8; border = 4; dark = "#000000"; light = "#ffffff")
saveQr:
twofa: proc saveQr(uri: AuthURI; path: string; scale = 8; border = 4; dark = "#000000"; light = "#ffffff"; options = defaultQrEncodeOptions())
secretSize:
otp: const secretSize
timecode:
otp: proc timecode(interval: int; timestamp: int): int
TOTP:
otp: object TOTP
verify:
otp: proc verify(self: HOTP; otp: int; counter: int = 0): bool
otp: proc verify(self: TOTP; otp: int; timestamp: int = 0; window: int = defaultWindow): bool
VERSION:
base32: const VERSION