From: Chris Duncan Date: Fri, 22 Aug 2025 07:32:45 +0000 (-0700) Subject: Add method to convert base32 directly to buffer. X-Git-Tag: v0.10.5~41^2~6 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=ad40d357e3b4aa8e82dccdc7924eea0410272ce6;p=libnemo.git Add method to convert base32 directly to buffer. --- 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 {