\r
export const base32 = {\r
/**\r
- * Convert a base32 string to a Uint8Array of bytes.\r
+ * Converts a base32 string to a Uint8Array of bytes.\r
*\r
* @param {string} base32 - String to convert\r
* @returns {Uint8Array} Byte array representation of the input string\r
output = output.slice(1)\r
}\r
return output\r
+ },\r
+ /**\r
+ * Converts a base32 string to a hexadecimal string.\r
+ *\r
+ * @param {string} base32 - String to convert\r
+ * @returns {string} Hexadecimal representation of the input base32\r
+ */\r
+ toHex (base32: string): string {\r
+ return bytes.toHex(this.toBytes(base32))\r
}\r
}\r
\r
return new Uint8Array(bytes)\r
},\r
/**\r
- * Convert a binary string to a hexadecimal representation\r
+ * Convert a binary string to a hexadecimal string.\r
*\r
* @param {string} bin - String to convert\r
- * @returns {string} Hexadecimal representation of the input string\r
+ * @returns {string} Hexadecimal string representation of the input binary\r
*/\r
toHex (bin: string): string {\r
return parseInt(bin, 2).toString(16)\r