Rename base64 functions such that imports don't need renaming.

This commit is contained in:
2025-12-09 15:55:03 +00:00
parent bfc5b11cc2
commit 03368b1b84
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -13,7 +13,7 @@
* @param {string} str - Base64url encoded string
* @returns {Uint8Array} - Decoded bytes
*/
export function dec(str) {
export function b64dec(str) {
// Convert URL-safe characters to standard base64
const base64 = str.replace(/-/g, '+').replace(/_/g, '/')
// Add padding if needed
@@ -26,7 +26,7 @@ export function dec(str) {
* @param {Uint8Array} bytes - Bytes to encode
* @returns {string} - Base64url encoded string (no padding)
*/
export function enc(bytes) {
export function b64enc(bytes) {
const base64 = btoa(String.fromCharCode(...bytes))
// Convert to URL-safe and remove padding
return base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')