v1
4/30/2020 by spalt08 4/30/202000
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const uint = new Uint8Array(200);
crypto.getRandomValues(uint);
const buffer = uint.buffer;
const decoder = new TextDecoder("utf-8");
const reader = new FileReader();

function v0(n){for(var r,t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=new Uint8Array(n),f=a.byteLength,i=f%3,o=f-i,u=0;u<o;u+=3)t+=e[(16515072&(r=a[u]<<16|a[u+1]<<8|a[u+2]))>>18]+e[(258048&r)>>12]+e[(4032&r)>>6]+e[63&r];return 1==i?t+=e[(252&(r=a[o]))>>2]+e[(3&r)<<4]+"==":2==i&&(t+=e[(64512&(r=a[o]<<8|a[1+o]))>>10]+e[(1008&r)>>4]+e[(15&r)<<2]+"="),t}

function v1(buffer) {
     const binary = String.fromCharCode.apply(null, new Uint8Array(buffer));
     return window.btoa(binary);
}


function v2(buffer){
  var tmp;

  tmp = decoder.decode(buffer); //to UTF-8 text.
  tmp = unescape(encodeURIComponent(tmp));         //to binary-string.
  tmp = btoa(tmp);                                 //BASE64.
  return tmp;
}


function v3(buffer) {
  	let str = '';
  let buf = new Uint8Array(buffer);
  for (let i = 0; i < buf.length; i++) str += String.fromCharCode(buf[i]);
     return window.btoa(str);
}

function v4(b, cb) {
  const blob = new Blob([b], { type: 'image/jpeg' });
  reader.onload = () => cb(reader.result);
  reader.readAsDataURL(blob);
}
function v5(b) {
  const blob = new Blob([b], { type: 'image/jpeg' });
  return URL.createObjectURL(blob);
}
delete caserun single casemove downdrag and drop case


ready




v1(buffer);
delete caserun single casemove upmove downdrag and drop case


ready



v2(buffer);
delete caserun single casemove upmove downdrag and drop case


ready



v3(buffer);
delete caserun single casemove upmove downdrag and drop case


ready



v0(buffer);
delete caserun single casemove upmove downdrag and drop case


ready



v5(buffer);
delete caserun single casemove updrag and drop case


ready




v4(buffer, () => deferred.resolve());
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN