summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'packages/browser/src/helpers')
-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);
}