Skip to content

Instantly share code, notes, and snippets.

@fguisso
Created June 30, 2017 14:36
Show Gist options
  • Save fguisso/22e9b98c40761503c4a6ed9cf78a36ac to your computer and use it in GitHub Desktop.
Save fguisso/22e9b98c40761503c4a6ed9cf78a36ac to your computer and use it in GitHub Desktop.
fix data from FileReader()
function fixdata (data) {
let o = ''
let l = 0
const w = 10240
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
return o
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment