otplib API Documentation / otplib / Base32Plugin
Type Alias: Base32Plugin
Base32Plugin =
object
Defined in: core/src/types.ts:73
Base32 plugin type for abstracting Base32 encoding/decoding across different implementations (native, TypeScript, etc.)
Properties
name
readonlyname:string
Defined in: core/src/types.ts:77
The name of the base32 plugin (e.g., 'native', 'ts')
Methods
decode()
decode(
str):Uint8Array
Defined in: core/src/types.ts:95
Decode Base32 string to binary data
Parameters
str
string
Base32 string to decode
Returns
Uint8Array
Decoded Uint8Array
Throws
If string contains invalid characters
encode()
encode(
data,options?):string
Defined in: core/src/types.ts:86
Encode binary data to Base32 string
Parameters
data
Uint8Array
Uint8Array to encode
options?
Encoding options
Returns
string
Base32 encoded string