summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/helpers/toUint8Array.ts
blob: a807a88c21ce92b69167e85f5c3e4f085361ea0e (plain)
1
2
3
4
5
6
7
/**
 * A helper method to convert a string sent from the server to a Uint8Array the authenticator will
 * expect.
 */
export default function toUint8Array(value: string): Uint8Array {
  return Uint8Array.from(value, c => c.charCodeAt(0));
}