summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/helpers/bufferToUTF8String.ts
blob: 0da3246a557bf30de164d4bc289224dbe3e121e8 (plain)
1
2
3
4
5
6
7
/**
 * A helper method to convert an arbitrary ArrayBuffer, returned from an authenticator, to a UTF-8
 * string.
 */
export function bufferToUTF8String(value: ArrayBuffer): string {
  return new TextDecoder('utf-8').decode(value);
}