File size: 233 Bytes
5240c42
 
 
 
 
 
1
2
3
4
5
6
export const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
  let binary = "";
  const bytes = [].slice.call(new Uint8Array(buffer));
  bytes.forEach((b: any) => (binary += String.fromCharCode(b)));
  return window.btoa(binary);
};