summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/helpers/stringToArrayBuffer.ts
blob: e3edd41a68de768660b873f73a33ff871456d295 (plain)
1
2
3
4
5
6
7
/**
 * A helper method to convert an arbitrary string sent from the server to a Uint8Array the
 * authenticator will expect.
 */
export default function stringToArrayBuffer(value: string): ArrayBuffer {
  return new TextEncoder().encode(value);
}