summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/helpers/toUint8Array.ts
diff options
context:
space:
mode:
authorAntoine Cormouls <contact.antoine.cormouls@gmail.com>2020-12-21 15:07:41 +0100
committerAntoine Cormouls <contact.antoine.cormouls@gmail.com>2020-12-21 15:07:41 +0100
commite63ed0d6a2c51e86ce37e6a5e124c2feb124e9f4 (patch)
treeb3ffc31c1d4c5cfd8e9e05bcd325f849d9db48ab /packages/browser/src/helpers/toUint8Array.ts
parent973797b1351829bae24ad42ae2bdddcebc6c518a (diff)
remove global text encoder
Diffstat (limited to 'packages/browser/src/helpers/toUint8Array.ts')
-rw-r--r--packages/browser/src/helpers/toUint8Array.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/packages/browser/src/helpers/toUint8Array.ts b/packages/browser/src/helpers/toUint8Array.ts
index 1855dd7..1e2243f 100644
--- a/packages/browser/src/helpers/toUint8Array.ts
+++ b/packages/browser/src/helpers/toUint8Array.ts
@@ -1,9 +1,7 @@
-const utf8Encoder = new TextEncoder();
-
/**
* A helper method to convert an arbitrary string sent from the server to a Uint8Array the
* authenticator will expect.
*/
export default function toUint8Array(value: string): Uint8Array {
- return utf8Encoder.encode(value);
+ return new TextEncoder().encode(value);
}