feat: 支持前后一体登录模板

This commit is contained in:
qiang
2021-01-16 16:36:23 +08:00
parent e8c552a394
commit 14a86cb305
107 changed files with 5637 additions and 1319 deletions
File diff suppressed because one or more lines are too long
+4 -3
View File
@@ -17,6 +17,7 @@ function unbzip2Stream() {
if(!blockSize){
blockSize = bz2.header(bitReader);
//console.error("got header of", blockSize);
streamCRC = 0;
return true;
}else{
var bufsize = 100000 * blockSize;
@@ -34,7 +35,7 @@ function unbzip2Stream() {
return false;
}else{
//console.error('decompressed', chunk.length,'bytes');
push(new Buffer(chunk));
push(Buffer.from(chunk));
return true;
}
}
@@ -78,12 +79,12 @@ function unbzip2Stream() {
},
function end(x) {
//console.error(x,'last compressing with', hasBytes, 'bytes in buffer');
while (!broken && hasBytes > bitReader.bytesRead){
while (!broken && bitReader && hasBytes > bitReader.bytesRead){
decompressAndQueue(this);
}
if (!broken) {
if (streamCRC !== null)
stream.emit('error', new Error("input stream ended prematurely"));
this.emit('error', new Error("input stream ended prematurely"));
this.queue(null);
}
}
+4 -6
View File
@@ -241,8 +241,8 @@ bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) {
hufGroup.minLen = minLen;
hufGroup.maxLen = maxLen;
var base = hufGroup.base.subarray(1);
var limit = hufGroup.limit.subarray(1);
var base = hufGroup.base;
var limit = hufGroup.limit;
var pp = 0;
for(var i = minLen; i <= maxLen; i++)
for(var t = 0; t < symCount; t++)
@@ -271,8 +271,8 @@ bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) {
symCount = GROUP_SIZE - 1;
if (selector >= nSelectors) message.Error("meow i'm a kitty, that's an error");
hufGroup = groups[this.selectors[selector++]];
base = hufGroup.base.subarray(1);
limit = hufGroup.limit.subarray(1);
base = hufGroup.base;
limit = hufGroup.limit;
}
i = hufGroup.minLen;
j = bits(i);
@@ -358,8 +358,6 @@ bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) {
crc = (crc ^ (-1)) >>> 0;
if ((crc|0) != (crcblock|0)) message.Error("Error in bzip2: crc32 do not match");
if (streamCRC === null)
streamCRC = 0;
streamCRC = (crc ^ ((streamCRC << 1) | (streamCRC >>> 31))) & 0xFFFFFFFF;
return streamCRC;
}
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "unbzip2-stream",
"version": "1.3.1",
"version": "1.4.3",
"description": "streaming unbzip2 implementation in pure javascript for node and browsers",
"keywords": [
"bzip",
@@ -34,18 +34,18 @@
],
"main": "index.js",
"devDependencies": {
"beefy": "^2.1.2",
"beefy": "^2.1.8",
"brfs": "^1.2.0",
"browserify": "^8.1.0",
"browserify": "^16.2.3",
"concat-stream": "^1.4.7",
"stream-equal": "^1.1.1",
"tape": "^3.4.0",
"tape": "^4.9.2",
"tape-run": "^4.0.0",
"uglify-js": "^3.0.10"
},
"dependencies": {
"through": "^2.3.6",
"buffer": "^3.0.1"
"buffer": "^5.2.1",
"through": "^2.3.8"
},
"license": "MIT"
}