diff options
author | Matthew Miller <matthew@millerti.me> | 2023-08-18 11:11:56 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2023-08-18 11:11:56 -0700 |
commit | dfb32f4891f6c955c25b2f305fa702cdaf8c5a5e (patch) | |
tree | 07c3c57caa54c77a08a209fd3cc509a359ed03e4 /packages/browser/src/helpers/base64URLStringToBuffer.ts | |
parent | de5e22f5fec4eb980c77f00c586a1179565359d7 (diff) |
Format browser
Diffstat (limited to 'packages/browser/src/helpers/base64URLStringToBuffer.ts')
-rw-r--r-- | packages/browser/src/helpers/base64URLStringToBuffer.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/browser/src/helpers/base64URLStringToBuffer.ts b/packages/browser/src/helpers/base64URLStringToBuffer.ts index f30b3d5..db78b35 100644 --- a/packages/browser/src/helpers/base64URLStringToBuffer.ts +++ b/packages/browser/src/helpers/base64URLStringToBuffer.ts @@ -7,7 +7,7 @@ */ export function base64URLStringToBuffer(base64URLString: string): ArrayBuffer { // Convert from Base64URL to Base64 - const base64 = base64URLString.replace(/-/g, '+').replace(/_/g, '/'); + const base64 = base64URLString.replace(/-/g, "+").replace(/_/g, "/"); /** * Pad with '=' until it's a multiple of four * (4 - (85 % 4 = 1) = 3) % 4 = 3 padding @@ -16,7 +16,7 @@ export function base64URLStringToBuffer(base64URLString: string): ArrayBuffer { * (4 - (88 % 4 = 0) = 4) % 4 = 0 padding */ const padLength = (4 - (base64.length % 4)) % 4; - const padded = base64.padEnd(base64.length + padLength, '='); + const padded = base64.padEnd(base64.length + padLength, "="); // Convert to a binary string const binary = atob(padded); |