function toBase64(arr) {
  arr = new Uint8Array(arr)
  return btoa(
    arr.reduce((data, byte) => data + String.fromCharCode(byte),'')
    );
  }
// To show retrieved data on screen
To show retrieved data on screen
To show retrieved data on screen
function toBase64(arr) {
  arr = new Uint8Array(arr)
  return btoa(
    arr.reduce((data, byte) => data + String.fromCharCode(byte),'')
    );
  }
function toBase64 ( arr ) { arr = new Uint8Array ( arr ) return btoa ( arr . reduce ( ( data , byte ) => data + String . fromCharCode ( byte ) , '' ) ) ; }
To show retrieved data on screen
To show retrieved data on screen