From 131066172d0456ffe87362136361ec9d460c7e90 Mon Sep 17 00:00:00 2001 From: yuche Date: Mon, 10 Jun 2024 10:58:28 +0800 Subject: [PATCH] feat: add `base64urlToHex` function --- .changeset/config.json | 2 +- packages/common/src/utils/buffer.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index 2ded1e3..d48d216 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -12,5 +12,5 @@ "access": "restricted", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": ["*-demo"] } diff --git a/packages/common/src/utils/buffer.ts b/packages/common/src/utils/buffer.ts index 1e4339a..8e00d7e 100644 --- a/packages/common/src/utils/buffer.ts +++ b/packages/common/src/utils/buffer.ts @@ -105,3 +105,7 @@ export function hexToString(hex: string): string { str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)) return str } + +export function base64urlToHex(s: string) { + return bufferToHex(base64URLStringToBuffer(s)) +}