Commit 156a0202 authored by Skye Yu's avatar Skye Yu

test:

parent 9a9139a6
......@@ -717,8 +717,11 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
let handler = (msg) => {
if (msg != null) {
flen += msg.body.length || msg.body.byteLength;
// const data = msg.body.join('').replace(/4869446F636B564D.*/, '').split('');
ondata(msg.body);
let hexString = Array.from(msg.body).map(b => b.toString(16).padStart(2, '0')).join('');
let regex = /4869446f636b564d.*/;
let result = hexString.replace(regex, '');
let data = new Uint8Array(result.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
ondata(data);
// return OK indicates all file blocks received
if (flen >= length) return 'OK';
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment