summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/helpers/toUint8Array.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2021-02-04 09:45:52 -0800
committerMatthew Miller <matthew@millerti.me>2021-02-04 09:45:52 -0800
commitc58ca6abf0d64a85771a865cf59f9783a20c66f0 (patch)
tree3f44297f5b47abf1b88db49ae11e399282a9adaf /packages/browser/src/helpers/toUint8Array.ts
parentd8cbcb40b9f32d7a6eab82f5e31c6e5272c9d163 (diff)
Restore userID argument in attestation options
Diffstat (limited to 'packages/browser/src/helpers/toUint8Array.ts')
-rw-r--r--packages/browser/src/helpers/toUint8Array.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/browser/src/helpers/toUint8Array.ts b/packages/browser/src/helpers/toUint8Array.ts
new file mode 100644
index 0000000..1e2243f
--- /dev/null
+++ b/packages/browser/src/helpers/toUint8Array.ts
@@ -0,0 +1,7 @@
+/**
+ * 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 new TextEncoder().encode(value);
+}