diff options
Diffstat (limited to 'packages/browser/src/helpers/toUint8Array.ts')
-rw-r--r-- | packages/browser/src/helpers/toUint8Array.ts | 7 |
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); +} |