From ad40d357e3b4aa8e82dccdc7924eea0410272ce6 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 22 Aug 2025 00:32:45 -0700 Subject: [PATCH] Add method to convert base32 directly to buffer. --- src/lib/convert.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/convert.ts b/src/lib/convert.ts index f9f9273..c270fb3 100644 --- a/src/lib/convert.ts +++ b/src/lib/convert.ts @@ -40,6 +40,16 @@ export class base32 { } return output } + + /** + * Convert a base32 string to an ArrayBuffer. + * + * @param {string} base32 - String to convert + * @returns {Uint8Array} Byte array representation of the input string + */ + static toBuffer (base32: string): ArrayBuffer { + return this.toBytes(base32).buffer + } } export class bin { -- 2.47.3