var n = e.access_token,
r = new vt.BigNumber('0x'.concat(gt() (n).slice(0, 16))),
i = new vt.BigNumber(t.file.size),
o = i ? r.mod(i) : new vt.BigNumber(0);
return (0, B.D) (t.file.slice(o.toNumber(), Math.min(o.plus(8).toNumber(), t.file.size))).pipe((0, q.w) ((function (e) {
var t = new FileReader;
return t.readAsDataURL(e),
(0, C.R) (t, 'load').pipe((0, V.U) ((function () {
return t.result.split(',') [1]
})), (0, be.q) (1))
})))
})))
accesstoken为用户token
r为根据用户token进行混淆加密并截断,我已经整理好了,代码如下
function o(e, t) {
var n = (65535 & e) + (65535 & t);
return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n
}
function a(e, t, n, r, i, a) {
return o((s = o(o(t, e), o(r, a))) << (l = i) | s >>> 32 - l, n);
var s,
l
}
function s(e, t, n, r, i, o, s) {
return a(t & n | ~t & r, e, t, i, o, s)
}
function l(e, t, n, r, i, o, s) {
return a(t & r | n & ~r, e, t, i, o, s)
}
function c(e, t, n, r, i, o, s) {
return a(t ^ n ^ r, e, t, i, o, s)
}
function u(e, t, n, r, i, o, s) {
return a(n ^ (t | ~r), e, t, i, o, s)
}
function m(e) {
return unescape(encodeURIComponent(e))
}
function h(e) {
var t,
n = [
];
for (n[(e.length >> 2) - 1] = void 0, t = 0; t < n.length; t += 1) n[t] = 0;
var r = 8 * e.length;
for (t = 0; t < r; t += 8) n[t >> 5] |= (255 & e.charCodeAt(t / 8)) << t % 32;
return n
}
function d(e, t) {
var n,
r,
i,
a,
d;
e[t >> 5] |= 128 << t % 32,
e[14 + (t + 64 >>> 9 << 4)] = t;
var f = 1732584193,
h = - 271733879,
p = - 1732584194,
m = 271733878;
for (n = 0; n < e.length; n += 16) r = f,
i = h,
a = p,
d = m,
f = s(f, h, p, m, e[n], 7, - 680876936),
m = s(m, f, h, p, e[n + 1], 12, - 389564586),
p = s(p, m, f, h, e[n + 2], 17, 606105819),
h = s(h, p, m, f, e[n + 3], 22, - 1044525330),
f = s(f, h, p, m, e[n + 4], 7, - 176418897),
m = s(m, f, h, p, e[n + 5], 12, 1200080426),
p = s(p, m, f, h, e[n + 6], 17, - 1473231341),
h = s(h, p, m, f, e[n + 7], 22, - 45705983),
f = s(f, h, p, m, e[n + 8], 7, 1770035416),
m = s(m, f, h, p, e[n + 9], 12, - 1958414417),
p = s(p, m, f, h, e[n + 10], 17, - 42063),
h = s(h, p, m, f, e[n + 11], 22, - 1990404162),
f = s(f, h, p, m, e[n + 12], 7, 1804603682),
m = s(m, f, h, p, e[n + 13], 12, - 40341101),
p = s(p, m, f, h, e[n + 14], 17, - 1502002290),
f = l(f, h = s(h, p, m, f, e[n + 15], 22, 1236535329), p, m, e[n + 1], 5, - 165796510),
m = l(m, f, h, p, e[n + 6], 9, - 1069501632),
p = l(p, m, f, h, e[n + 11], 14, 643717713),
h = l(h, p, m, f, e[n], 20, - 373897302),
f = l(f, h, p, m, e[n + 5], 5, - 701558691),
m = l(m, f, h, p, e[n + 10], 9, 38016083),
p = l(p, m, f, h, e[n + 15], 14, - 660478335),
h = l(h, p, m, f, e[n + 4], 20, - 405537848),
f = l(f, h, p, m, e[n + 9], 5, 568446438),
m = l(m, f, h, p, e[n + 14], 9, - 1019803690),
p = l(p, m, f, h, e[n + 3], 14, - 187363961),
h = l(h, p, m, f, e[n + 8], 20, 1163531501),
f = l(f, h, p, m, e[n + 13], 5, - 1444681467),
m = l(m, f, h, p, e[n + 2], 9, - 51403784),
p = l(p, m, f, h, e[n + 7], 14, 1735328473),
f = c(f, h = l(h, p, m, f, e[n + 12], 20, - 1926607734), p, m, e[n + 5], 4, - 378558),
m = c(m, f, h, p, e[n + 8], 11, - 2022574463),
p = c(p, m, f, h, e[n + 11], 16, 1839030562),
h = c(h, p, m, f, e[n + 14], 23, - 35309556),
f = c(f, h, p, m, e[n + 1], 4, - 1530992060),
m = c(m, f, h, p, e[n + 4], 11, 1272893353),
p = c(p, m, f, h, e[n + 7], 16, - 155497632),
h = c(h, p, m, f, e[n + 10], 23, - 1094730640),
f = c(f, h, p, m, e[n + 13], 4, 681279174),
m = c(m, f, h, p, e[n], 11, - 358537222),
p = c(p, m, f, h, e[n + 3], 16, - 722521979),
h = c(h, p, m, f, e[n + 6], 23, 76029189),
f = c(f, h, p, m, e[n + 9], 4, - 640364487),
m = c(m, f, h, p, e[n + 12], 11, - 421815835),
p = c(p, m, f, h, e[n + 15], 16, 530742520),
f = u(f, h = c(h, p, m, f, e[n + 2], 23, - 995338651), p, m, e[n], 6, - 198630844),
m = u(m, f, h, p, e[n + 7], 10, 1126891415),
p = u(p, m, f, h, e[n + 14], 15, - 1416354905),
h = u(h, p, m, f, e[n + 5], 21, - 57434055),
f = u(f, h, p, m, e[n + 12], 6, 1700485571),
m = u(m, f, h, p, e[n + 3], 10, - 1894986606),
p = u(p, m, f, h, e[n + 10], 15, - 1051523),
h = u(h, p, m, f, e[n + 1], 21, - 2054922799),
f = u(f, h, p, m, e[n + 8], 6, 1873313359),
m = u(m, f, h, p, e[n + 15], 10, - 30611744),
p = u(p, m, f, h, e[n + 6], 15, - 1560198380),
h = u(h, p, m, f, e[n + 13], 21, 1309151649),
f = u(f, h, p, m, e[n + 4], 6, - 145523070),
m = u(m, f, h, p, e[n + 11], 10, - 1120210379),
p = u(p, m, f, h, e[n + 2], 15, 718787259),
h = u(h, p, m, f, e[n + 9], 21, - 343485551),
f = o(f, r),
h = o(h, i),
p = o(p, a),
m = o(m, d);
return [f,
h,
p,
m]
}
function f(e) {
var t,
n = '',
r = 32 * e.length;
for (t = 0; t < r; t += 8) n += String.fromCharCode(e[t >> 5] >>> t % 32 & 255);
return n
}
function p(e) {
var t,
n,
r = '0123456789abcdef',
i = '';
for (n = 0; n < e.length; n += 1) t = e.charCodeAt(n),
i += r.charAt(t >>> 4 & 15) + r.charAt(15 & t);
return i
}
function A(e) {
return function (e) {
return f(d(h(e), 8 * e.length))
}(m(e))
}
function v(e, t, n) {
return t ? n ? g(t, e) : p(g(t, e)) : n ? A(e) : p(A(e))
}
function CalcV(e){
return '0x'+v(e).slice(0, 16)
}
i为文件大小
o = i ? r.mod(i) : new vt.BigNumber(0);
o将文件大小以及accesstoken的number进行了混合运算
t.file.slice(o.toNumber(), Math.min(o.plus(8).toNumber(), t.file.size))
t.file是一个file对象,silce为截断函数
即将o到Math.min计算的结果中间的数字,用silce函数进行阶段获取到blob并base64化取得proof参
技术理论来说,宣布凉凉