aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/web-crypto.test.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-31 17:55:16 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-31 17:55:16 -0800
commitcc4326cd829decc95d1f1f23998f97705637e04b (patch)
tree9ccaa829b6d48af521d5e5fcdbabc0dac8d186af /test/bun.js/web-crypto.test.ts
parentc57b37d29f9d04780c7f7917789cf8b424710d23 (diff)
downloadbun-cc4326cd829decc95d1f1f23998f97705637e04b.tar.gz
bun-cc4326cd829decc95d1f1f23998f97705637e04b.tar.zst
bun-cc4326cd829decc95d1f1f23998f97705637e04b.zip
Re-run prettier after changes
Diffstat (limited to 'test/bun.js/web-crypto.test.ts')
-rw-r--r--test/bun.js/web-crypto.test.ts15
1 files changed, 3 insertions, 12 deletions
diff --git a/test/bun.js/web-crypto.test.ts b/test/bun.js/web-crypto.test.ts
index 19d068180..d7afd523c 100644
--- a/test/bun.js/web-crypto.test.ts
+++ b/test/bun.js/web-crypto.test.ts
@@ -49,11 +49,7 @@ describe("Web Crypto", () => {
async function signResponse(message, secret) {
const key = await importKey(secret);
- const signature = await crypto.subtle.sign(
- "HMAC",
- key,
- new TextEncoder().encode(message),
- );
+ const signature = await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(message));
// Convert ArrayBuffer to Base64
return btoa(String.fromCharCode(...new Uint8Array(signature)));
@@ -63,14 +59,9 @@ describe("Web Crypto", () => {
const key = await importKey(secret);
// Convert Base64 to Uint8Array
- const sigBuf = Uint8Array.from(atob(signature), (c) => c.charCodeAt(0));
+ const sigBuf = Uint8Array.from(atob(signature), c => c.charCodeAt(0));
- return await crypto.subtle.verify(
- "HMAC",
- key,
- sigBuf,
- new TextEncoder().encode(message),
- );
+ return await crypto.subtle.verify("HMAC", key, sigBuf, new TextEncoder().encode(message));
}
const msg = `hello world`;