dd
This commit is contained in:
14
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/LICENSE
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (C) 2014-present SheetJS
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
139
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/README.md
generated
vendored
Normal file
139
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/README.md
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
# adler32
|
||||
|
||||
Signed ADLER-32 algorithm implementation in JS (for the browser and nodejs).
|
||||
Emphasis on correctness, performance, and IE6+ support.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://www.npmjs.org/package/adler-32):
|
||||
|
||||
```bash
|
||||
$ npm install adler-32
|
||||
```
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="adler32.js"></script>
|
||||
```
|
||||
|
||||
The browser exposes a variable `ADLER32`.
|
||||
|
||||
When installed globally, npm installs a script `adler32` that computes the
|
||||
checksum for a specified file or standard input.
|
||||
|
||||
The script will manipulate `module.exports` if available . This is not always
|
||||
desirable. To prevent the behavior, define `DO_NOT_EXPORT_ADLER`.
|
||||
|
||||
## Usage
|
||||
|
||||
In all cases, the relevant function takes an argument representing data and an
|
||||
optional second argument representing the starting "seed" (for running hash).
|
||||
|
||||
The return value is a signed 32-bit integer.
|
||||
|
||||
- `ADLER32.buf(byte array or buffer[, seed])` assumes the argument is a sequence
|
||||
of 8-bit unsigned integers (nodejs `Buffer`, `Uint8Array` or array of bytes).
|
||||
|
||||
- `ADLER32.bstr(binary string[, seed])` assumes the argument is a binary string
|
||||
where byte `i` is the low byte of the UCS-2 char: `str.charCodeAt(i) & 0xFF`
|
||||
|
||||
- `ADLER32.str(string)` assumes the argument is a standard JS string and
|
||||
calculates the hash of the UTF-8 encoding.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
// var ADLER32 = require('adler-32'); // uncomment if in node
|
||||
ADLER32.str("SheetJS") // 176947863
|
||||
ADLER32.bstr("SheetJS") // 176947863
|
||||
ADLER32.buf([ 83, 104, 101, 101, 116, 74, 83 ]) // 176947863
|
||||
|
||||
adler32 = ADLER32.buf([83, 104]) // 17825980 "Sh"
|
||||
adler32 = ADLER32.str("eet", adler32) // 95486458 "Sheet"
|
||||
ADLER32.bstr("JS", adler32) // 176947863 "SheetJS"
|
||||
|
||||
[ADLER32.str("\u2603"), ADLER32.str("\u0003")] // [ 73138686, 262148 ]
|
||||
[ADLER32.bstr("\u2603"), ADLER32.bstr("\u0003")] // [ 262148, 262148 ]
|
||||
[ADLER32.buf([0x2603]), ADLER32.buf([0x0003])] // [ 262148, 262148 ]
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
`make test` will run the nodejs-based test.
|
||||
|
||||
To run the in-browser tests, run a local server and go to the `ctest` directory.
|
||||
`make ctestserv` will start a python `SimpleHTTPServer` server on port 8000.
|
||||
|
||||
To update the browser artifacts, run `make ctest`.
|
||||
|
||||
To generate the bits file, use the `adler32` function from python `zlib`:
|
||||
|
||||
```python
|
||||
>>> from zlib import adler32
|
||||
>>> x="foo bar baz٪☃🍣"
|
||||
>>> adler32(x)
|
||||
1543572022
|
||||
>>> adler32(x+x)
|
||||
-2076896149
|
||||
>>> adler32(x+x+x)
|
||||
2023497376
|
||||
```
|
||||
|
||||
The included `adler32.njs` script can process files or standard input:
|
||||
|
||||
```bash
|
||||
$ echo "this is a test" > t.txt
|
||||
$ bin/adler32.njs t.txt
|
||||
726861088
|
||||
```
|
||||
|
||||
For comparison, the included `adler32.py` script uses python `zlib`:
|
||||
|
||||
```bash
|
||||
$ bin/adler32.py t.txt
|
||||
726861088
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
`make perf` will run algorithmic performance tests (which should justify certain
|
||||
decisions in the code).
|
||||
|
||||
Bit twiddling is much faster than taking the mod in Safari and Firefox browsers.
|
||||
Instead of taking the literal mod 65521, it is faster to keep it in the integers
|
||||
by bit-shifting: `65536 ~ 15 mod 65521` so for nonnegative integer `a`:
|
||||
|
||||
```
|
||||
a = (a >>> 16) * 65536 + (a & 65535) [equality]
|
||||
a ~ (a >>> 16) * 15 + (a & 65535) mod 65521
|
||||
```
|
||||
|
||||
The mod is taken at the very end, since the intermediate result may exceed 65521
|
||||
|
||||
## Magic Number
|
||||
|
||||
The magic numbers were chosen so as to not overflow a 31-bit integer:
|
||||
|
||||
```mathematica
|
||||
F[n_] := Reduce[x*(x + 1)*n/2 + (x + 1)*(65521) < (2^31 - 1) && x > 0, x, Integers]
|
||||
F[255] (* bstr: x \[Element] Integers && 1 <= x <= 3854 *)
|
||||
F[127] (* ascii: x \[Element] Integers && 1 <= x <= 5321 *)
|
||||
```
|
||||
|
||||
Subtract up to 4 elements for the Unicode case.
|
||||
|
||||
## License
|
||||
|
||||
Please consult the attached LICENSE file for details. All rights not explicitly
|
||||
granted by the Apache 2.0 license are reserved by the Original Author.
|
||||
|
||||
## Badges
|
||||
|
||||
[](https://saucelabs.com/u/adler32)
|
||||
|
||||
[](https://travis-ci.org/SheetJS/js-adler32)
|
||||
|
||||
[](https://coveralls.io/r/SheetJS/js-adler32?branch=master)
|
||||
|
||||
[](https://github.com/SheetJS/js-adler32)
|
||||
92
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/adler32.js
generated
vendored
Normal file
92
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/adler32.js
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* vim: set ts=2: */
|
||||
/*exported ADLER32 */
|
||||
var ADLER32;
|
||||
(function (factory) {
|
||||
/*jshint ignore:start */
|
||||
/*eslint-disable */
|
||||
if(typeof DO_NOT_EXPORT_ADLER === 'undefined') {
|
||||
if('object' === typeof exports) {
|
||||
factory(exports);
|
||||
} else if ('function' === typeof define && define.amd) {
|
||||
define(function () {
|
||||
var module = {};
|
||||
factory(module);
|
||||
return module;
|
||||
});
|
||||
} else {
|
||||
factory(ADLER32 = {});
|
||||
}
|
||||
} else {
|
||||
factory(ADLER32 = {});
|
||||
}
|
||||
/*eslint-enable */
|
||||
/*jshint ignore:end */
|
||||
}(function(ADLER32) {
|
||||
ADLER32.version = '1.2.0';
|
||||
function adler32_bstr(bstr, seed) {
|
||||
var a = 1, b = 0, L = bstr.length, M = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850)+i;
|
||||
for(;i<M;i++) {
|
||||
a += bstr.charCodeAt(i)&0xFF;
|
||||
b += a;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
|
||||
function adler32_buf(buf, seed) {
|
||||
var a = 1, b = 0, L = buf.length, M = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = (seed >>> 16) & 0xFFFF; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850)+i;
|
||||
for(;i<M;i++) {
|
||||
a += buf[i]&0xFF;
|
||||
b += a;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
|
||||
function adler32_str(str, seed) {
|
||||
var a = 1, b = 0, L = str.length, M = 0, c = 0, d = 0;
|
||||
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
|
||||
for(var i = 0; i < L;) {
|
||||
M = Math.min(L-i, 3850);
|
||||
while(M>0) {
|
||||
c = str.charCodeAt(i++);
|
||||
if(c < 0x80) { a += c; }
|
||||
else if(c < 0x800) {
|
||||
a += 192|((c>>6)&31); b += a; --M;
|
||||
a += 128|(c&63);
|
||||
} else if(c >= 0xD800 && c < 0xE000) {
|
||||
c = (c&1023)+64; d = str.charCodeAt(i++) & 1023;
|
||||
a += 240|((c>>8)&7); b += a; --M;
|
||||
a += 128|((c>>2)&63); b += a; --M;
|
||||
a += 128|((d>>6)&15)|((c&3)<<4); b += a; --M;
|
||||
a += 128|(d&63);
|
||||
} else {
|
||||
a += 224|((c>>12)&15); b += a; --M;
|
||||
a += 128|((c>>6)&63); b += a; --M;
|
||||
a += 128|(c&63);
|
||||
}
|
||||
b += a; --M;
|
||||
}
|
||||
a = (15*(a>>>16)+(a&65535));
|
||||
b = (15*(b>>>16)+(b&65535));
|
||||
}
|
||||
return ((b%65521) << 16) | (a%65521);
|
||||
}
|
||||
// $FlowIgnore
|
||||
ADLER32.bstr = adler32_bstr;
|
||||
// $FlowIgnore
|
||||
ADLER32.buf = adler32_buf;
|
||||
// $FlowIgnore
|
||||
ADLER32.str = adler32_str;
|
||||
}));
|
||||
89
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/package.json
generated
vendored
Normal file
89
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/package.json
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"adler-32@1.2.0",
|
||||
"/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json"
|
||||
]
|
||||
],
|
||||
"_from": "adler-32@1.2.0",
|
||||
"_id": "adler-32@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
|
||||
"_location": "/node-xlsx/adler-32",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "adler-32@1.2.0",
|
||||
"name": "adler-32",
|
||||
"escapedName": "adler-32",
|
||||
"rawSpec": "1.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/node-xlsx/xlsx"
|
||||
],
|
||||
"_resolved": "https://registry.nlark.com/adler-32/download/adler-32-1.2.0.tgz",
|
||||
"_spec": "1.2.0",
|
||||
"_where": "/Users/wuyu/Desktop/61/Git/h5game_ailesson_v2.4/packages/excel_to_json",
|
||||
"author": {
|
||||
"name": "sheetjs"
|
||||
},
|
||||
"bin": {
|
||||
"adler32": "./bin/adler32.njs"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/SheetJS/js-adler32/issues"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": "adler32.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"printj": "~1.1.0"
|
||||
},
|
||||
"description": "Pure-JS ADLER-32",
|
||||
"devDependencies": {
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"blanket": "~1.2.3",
|
||||
"codepage": "~1.10.0",
|
||||
"dtslint": "^0.1.2",
|
||||
"mocha": "~2.5.3",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"files": [
|
||||
"adler32.js",
|
||||
"bin/adler32.njs",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"types/index.d.ts",
|
||||
"types/*.json"
|
||||
],
|
||||
"homepage": "http://sheetjs.com/opensource",
|
||||
"keywords": [
|
||||
"adler32",
|
||||
"checksum"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "./adler32",
|
||||
"name": "adler-32",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/SheetJS/js-adler32.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "make",
|
||||
"dtslint": "dtslint types",
|
||||
"lint": "make fullint",
|
||||
"test": "make test"
|
||||
},
|
||||
"types": "types",
|
||||
"version": "1.2.0"
|
||||
}
|
||||
14
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/types/index.d.ts
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/** Version string */
|
||||
export const version: string;
|
||||
|
||||
/** Process a node buffer or byte array */
|
||||
export function buf(data: number[] | Uint8Array, seed?: number): number;
|
||||
|
||||
/** Process a binary string */
|
||||
export function bstr(data: string, seed?: number): number;
|
||||
|
||||
/** Process a JS string based on the UTF8 encoding */
|
||||
export function str(data: string, seed?: number): number;
|
||||
14
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/types/tsconfig.json
generated
vendored
Normal file
14
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/types/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [ "es5" ],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": ".",
|
||||
"paths": { "adler-32": ["."] },
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
11
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/types/tslint.json
generated
vendored
Normal file
11
extensions/Excel转JSON/node_modules/node-xlsx/node_modules/adler-32/types/tslint.json
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "dtslint/dtslint.json",
|
||||
"rules": {
|
||||
"whitespace": false,
|
||||
"no-sparse-arrays": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"one-variable-per-declaration": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user