短视频去水印接口源码分析(今日头条第一弹)
首先两条重要的加密函数//今日头条crc32加密函数-1-1
function crc32_str(str, seed) {
var T = this.signed_crc_table();
var C = seed ^ -1;
for (var i = 0, L = str.length, c, d; i < L;) {
c = str.charCodeAt(i++);
if (c < 0x80) {
C = (C >>> 8) ^ T[(C ^ c) & 0xFF];
} else if (c < 0x800) {
C = (C >>> 8) ^ T[(C ^ (192 | ((c >> 6) & 31))) & 0xFF];
C = (C >>> 8) ^ T[(C ^ (128 | (c & 63))) & 0xFF];
} else if (c >= 0xD800 && c < 0xE000) {
c = (c & 1023) + 64;
d = str.charCodeAt(i++) & 1023;
C = (C >>> 8) ^ T[(C ^ (240 | ((c >> 8) & 7))) & 0xFF];
C = (C >>> 8) ^ T[(C ^ (128 | ((c >> 2) & 63))) & 0xFF];
C = (C >>> 8) ^ T[(C ^ (128 | ((d >> 6) & 15) | ((c & 3) << 4))) & 0xFF];
C = (C >>> 8) ^ T[(C ^ (128 | (d & 63))) & 0xFF];
} else {
C = (C >>> 8) ^ T[(C ^ (224 | ((c >> 12) & 15))) & 0xFF];
C = (C >>> 8) ^ T[(C ^ (128 | ((c >> 6) & 63))) & 0xFF];
C = (C >>> 8) ^ T[(C ^ (128 | (c & 63))) & 0xFF];
}
}
// return C ^ -1;
return (C ^ (-1)) >>> 0;
}
//今日头条crc32加密函数-1-2
function signed_crc_table() {
var c = 0,
table = new Array(256);
for (var n = 0; n != 256; ++n) {
c = n;
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
table = c;
}
return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
} dengjun4824037 发表于 2021-1-30 17:59
建议做个安卓版下载去水印工具就好啦
微信搜索吾爱助手小程序,直接用 发了两贴? 插个眼,养肥再看 建议做个安卓版下载去水印工具就好啦 老铁。搞个成品出来玩玩啊 大佬能不能研究一下tiktok去水印 谢谢大佬分享知识,受教 感谢大佬的无私分享 谢谢! 查眼,学习一下 支持一下,这个大佬的接口非常好用,感谢感谢~!
页:
[1]
2