Skip to content

Documents for @litert/otp / URL / IUrlInfoForHOTP

Interface: IUrlInfoForHOTP

Defined in: URL.ts:81

Extends

Properties

betterCompatibility?

optional betterCompatibility: boolean

Defined in: URL.ts:31

Do not escape '=' in the key/secret, to improve compatibility with some authenticator apps.

Default

ts
false

Inherited from

IUrlInfo.betterCompatibility


digest?

optional digest: EDigest

Defined in: URL.ts:78

The digest algorithm used to generate the OTP code.

Warning

Not all authenticator apps support SHA256 or SHA512.

Default

ts
'SHA1'

See

Inherited from

IUrlInfo.digest


digits?

optional digits: number

Defined in: URL.ts:56

The output width of OTP.

Default

ts
6

Warning

Not all authenticator apps support digits other than 6.

See

https://datatracker.ietf.org/doc/html/rfc4226#section-5

Inherited from

IUrlInfo.digits


issuer?

optional issuer: null | string

Defined in: URL.ts:66

The issuer of OTP code to display in OTP authenticator app.

Inherited from

IUrlInfo.issuer


key

key: string | Buffer<ArrayBufferLike>

Defined in: URL.ts:40

The key of OTP code.

If the key is a string, it must be BASE32-encoded.

See

https://datatracker.ietf.org/doc/html/rfc4226#section-5.1

Inherited from

IUrlInfo.key


label

label: string

Defined in: URL.ts:61

The label of OTP code to display in OTP authenticator app.

Inherited from

IUrlInfo.label


sequence?

optional sequence: number

Defined in: URL.ts:91

The base sequence of HOTP code.

Default

ts
1

See

https://datatracker.ietf.org/doc/html/rfc4226#appendix-E.3


type

type: "hotp"

Defined in: URL.ts:83

The type of OTP.

Overrides

IUrlInfo.type