@codingame/monaco-vscode-ipynb-default-extension 1.85.1 → 1.85.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -4
- package/package.json +2 -2
- package/resources/README.md +9 -0
- package/resources/cellAttachmentRenderer.js +1 -0
- package/resources/icon.png +0 -0
- package/resources/ipynbMain.js +2 -0
- package/resources/ipynbMain.js.map +1 -0
- package/resources/package.json +1 -0
- package/resources/package.nls.json +1 -0
- package/ipynbMain.js +0 -4308
- package/ipynbMain.js.map +0 -1
- package/package.nls.json +0 -16
package/ipynbMain.js
DELETED
|
@@ -1,4308 +0,0 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ var __webpack_modules__ = ([
|
|
3
|
-
/* 0 */,
|
|
4
|
-
/* 1 */
|
|
5
|
-
/***/ ((module) => {
|
|
6
|
-
|
|
7
|
-
"use strict";
|
|
8
|
-
module.exports = require("vscode");
|
|
9
|
-
|
|
10
|
-
/***/ }),
|
|
11
|
-
/* 2 */
|
|
12
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13
|
-
|
|
14
|
-
"use strict";
|
|
15
|
-
|
|
16
|
-
/*---------------------------------------------------------------------------------------------
|
|
17
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
19
|
-
*--------------------------------------------------------------------------------------------*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21
|
-
exports.getNotebookMetadata = exports.NotebookSerializer = void 0;
|
|
22
|
-
const detectIndent = __webpack_require__(3);
|
|
23
|
-
const vscode = __webpack_require__(1);
|
|
24
|
-
const constants_1 = __webpack_require__(4);
|
|
25
|
-
const deserializers_1 = __webpack_require__(5);
|
|
26
|
-
const serializers_1 = __webpack_require__(6);
|
|
27
|
-
const fnv = __webpack_require__(7);
|
|
28
|
-
class NotebookSerializer {
|
|
29
|
-
constructor(context) {
|
|
30
|
-
this.context = context;
|
|
31
|
-
}
|
|
32
|
-
async deserializeNotebook(content, _token) {
|
|
33
|
-
let contents = '';
|
|
34
|
-
try {
|
|
35
|
-
contents = new TextDecoder().decode(content);
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
}
|
|
39
|
-
let json = contents && /\S/.test(contents) ? JSON.parse(contents) : {};
|
|
40
|
-
if (json.__webview_backup) {
|
|
41
|
-
const backupId = json.__webview_backup;
|
|
42
|
-
const uri = this.context.globalStorageUri;
|
|
43
|
-
const folder = uri.with({ path: this.context.globalStorageUri.path.replace('vscode.ipynb', 'ms-toolsai.jupyter') });
|
|
44
|
-
const fileHash = fnv.fast1a32hex(backupId);
|
|
45
|
-
const fileName = `${fileHash}.ipynb`;
|
|
46
|
-
const file = vscode.Uri.joinPath(folder, fileName);
|
|
47
|
-
const data = await vscode.workspace.fs.readFile(file);
|
|
48
|
-
json = data ? JSON.parse(data.toString()) : {};
|
|
49
|
-
if (json.contents && typeof json.contents === 'string') {
|
|
50
|
-
contents = json.contents;
|
|
51
|
-
json = JSON.parse(contents);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (json.nbformat && json.nbformat < 4) {
|
|
55
|
-
throw new Error('Only Jupyter notebooks version 4+ are supported');
|
|
56
|
-
}
|
|
57
|
-
// Then compute indent from the contents (only use first 1K characters as a perf optimization)
|
|
58
|
-
const indentAmount = contents ? detectIndent(contents.substring(0, 1000)).indent : ' ';
|
|
59
|
-
const preferredCellLanguage = (0, deserializers_1.getPreferredLanguage)(json.metadata);
|
|
60
|
-
// Ensure we always have a blank cell.
|
|
61
|
-
if ((json.cells || []).length === 0) {
|
|
62
|
-
json.cells = [
|
|
63
|
-
{
|
|
64
|
-
cell_type: 'code',
|
|
65
|
-
execution_count: null,
|
|
66
|
-
metadata: {},
|
|
67
|
-
outputs: [],
|
|
68
|
-
source: ''
|
|
69
|
-
}
|
|
70
|
-
];
|
|
71
|
-
}
|
|
72
|
-
// For notebooks without metadata default the language in metadata to the preferred language.
|
|
73
|
-
if (!json.metadata || (!json.metadata.kernelspec && !json.metadata.language_info)) {
|
|
74
|
-
json.metadata = json.metadata || {};
|
|
75
|
-
json.metadata.language_info = json.metadata.language_info || { name: preferredCellLanguage };
|
|
76
|
-
}
|
|
77
|
-
const data = (0, deserializers_1.jupyterNotebookModelToNotebookData)(json, preferredCellLanguage);
|
|
78
|
-
data.metadata = data.metadata || {};
|
|
79
|
-
data.metadata.indentAmount = indentAmount;
|
|
80
|
-
return data;
|
|
81
|
-
}
|
|
82
|
-
serializeNotebook(data, _token) {
|
|
83
|
-
return new TextEncoder().encode(this.serializeNotebookToString(data));
|
|
84
|
-
}
|
|
85
|
-
serializeNotebookToString(data) {
|
|
86
|
-
const notebookContent = getNotebookMetadata(data);
|
|
87
|
-
// use the preferred language from document metadata or the first cell language as the notebook preferred cell language
|
|
88
|
-
const preferredCellLanguage = notebookContent.metadata?.language_info?.name ?? data.cells.find(cell => cell.kind === vscode.NotebookCellKind.Code)?.languageId;
|
|
89
|
-
notebookContent.cells = data.cells
|
|
90
|
-
.map(cell => (0, serializers_1.createJupyterCellFromNotebookCell)(cell, preferredCellLanguage))
|
|
91
|
-
.map(serializers_1.pruneCell);
|
|
92
|
-
const indentAmount = data.metadata && 'indentAmount' in data.metadata && typeof data.metadata.indentAmount === 'string' ?
|
|
93
|
-
data.metadata.indentAmount :
|
|
94
|
-
' ';
|
|
95
|
-
// ipynb always ends with a trailing new line (we add this so that SCMs do not show unnecessary changes, resulting from a missing trailing new line).
|
|
96
|
-
return JSON.stringify((0, serializers_1.sortObjectPropertiesRecursively)(notebookContent), undefined, indentAmount) + '\n';
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.NotebookSerializer = NotebookSerializer;
|
|
100
|
-
function getNotebookMetadata(document) {
|
|
101
|
-
const notebookContent = document.metadata?.custom || {};
|
|
102
|
-
notebookContent.cells = notebookContent.cells || [];
|
|
103
|
-
notebookContent.nbformat = notebookContent.nbformat || constants_1.defaultNotebookFormat.major;
|
|
104
|
-
notebookContent.nbformat_minor = notebookContent.nbformat_minor ?? constants_1.defaultNotebookFormat.minor;
|
|
105
|
-
notebookContent.metadata = notebookContent.metadata || {};
|
|
106
|
-
return notebookContent;
|
|
107
|
-
}
|
|
108
|
-
exports.getNotebookMetadata = getNotebookMetadata;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/***/ }),
|
|
112
|
-
/* 3 */
|
|
113
|
-
/***/ ((module) => {
|
|
114
|
-
|
|
115
|
-
"use strict";
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// Detect either spaces or tabs but not both to properly handle tabs for indentation and spaces for alignment
|
|
119
|
-
const INDENT_REGEX = /^(?:( )+|\t+)/;
|
|
120
|
-
|
|
121
|
-
const INDENT_TYPE_SPACE = 'space';
|
|
122
|
-
const INDENT_TYPE_TAB = 'tab';
|
|
123
|
-
|
|
124
|
-
// Make a Map that counts how many indents/unindents have occurred for a given size and how many lines follow a given indentation.
|
|
125
|
-
// The key is a concatenation of the indentation type (s = space and t = tab) and the size of the indents/unindents.
|
|
126
|
-
//
|
|
127
|
-
// indents = {
|
|
128
|
-
// t3: [1, 0],
|
|
129
|
-
// t4: [1, 5],
|
|
130
|
-
// s5: [1, 0],
|
|
131
|
-
// s12: [1, 0],
|
|
132
|
-
// }
|
|
133
|
-
function makeIndentsMap(string, ignoreSingleSpaces) {
|
|
134
|
-
const indents = new Map();
|
|
135
|
-
|
|
136
|
-
// Remember the size of previous line's indentation
|
|
137
|
-
let previousSize = 0;
|
|
138
|
-
let previousIndentType;
|
|
139
|
-
|
|
140
|
-
// Indents key (ident type + size of the indents/unindents)
|
|
141
|
-
let key;
|
|
142
|
-
|
|
143
|
-
for (const line of string.split(/\n/g)) {
|
|
144
|
-
if (!line) {
|
|
145
|
-
// Ignore empty lines
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
let indent;
|
|
150
|
-
let indentType;
|
|
151
|
-
let weight;
|
|
152
|
-
let entry;
|
|
153
|
-
const matches = line.match(INDENT_REGEX);
|
|
154
|
-
|
|
155
|
-
if (matches === null) {
|
|
156
|
-
previousSize = 0;
|
|
157
|
-
previousIndentType = '';
|
|
158
|
-
} else {
|
|
159
|
-
indent = matches[0].length;
|
|
160
|
-
|
|
161
|
-
if (matches[1]) {
|
|
162
|
-
indentType = INDENT_TYPE_SPACE;
|
|
163
|
-
} else {
|
|
164
|
-
indentType = INDENT_TYPE_TAB;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// Ignore single space unless it's the only indent detected to prevent common false positives
|
|
168
|
-
if (ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && indent === 1) {
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (indentType !== previousIndentType) {
|
|
173
|
-
previousSize = 0;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
previousIndentType = indentType;
|
|
177
|
-
|
|
178
|
-
weight = 0;
|
|
179
|
-
|
|
180
|
-
const indentDifference = indent - previousSize;
|
|
181
|
-
previousSize = indent;
|
|
182
|
-
|
|
183
|
-
// Previous line have same indent?
|
|
184
|
-
if (indentDifference === 0) {
|
|
185
|
-
weight++;
|
|
186
|
-
// We use the key from previous loop
|
|
187
|
-
} else {
|
|
188
|
-
const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference;
|
|
189
|
-
key = encodeIndentsKey(indentType, absoluteIndentDifference);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Update the stats
|
|
193
|
-
entry = indents.get(key);
|
|
194
|
-
|
|
195
|
-
if (entry === undefined) {
|
|
196
|
-
entry = [1, 0]; // Init
|
|
197
|
-
} else {
|
|
198
|
-
entry = [++entry[0], entry[1] + weight];
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
indents.set(key, entry);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return indents;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Encode the indent type and amount as a string (e.g. 's4') for use as a compound key in the indents Map.
|
|
209
|
-
function encodeIndentsKey(indentType, indentAmount) {
|
|
210
|
-
const typeCharacter = indentType === INDENT_TYPE_SPACE ? 's' : 't';
|
|
211
|
-
return typeCharacter + String(indentAmount);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Extract the indent type and amount from a key of the indents Map.
|
|
215
|
-
function decodeIndentsKey(indentsKey) {
|
|
216
|
-
const keyHasTypeSpace = indentsKey[0] === 's';
|
|
217
|
-
const type = keyHasTypeSpace ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB;
|
|
218
|
-
|
|
219
|
-
const amount = Number(indentsKey.slice(1));
|
|
220
|
-
|
|
221
|
-
return {type, amount};
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Return the key (e.g. 's4') from the indents Map that represents the most common indent,
|
|
225
|
-
// or return undefined if there are no indents.
|
|
226
|
-
function getMostUsedKey(indents) {
|
|
227
|
-
let result;
|
|
228
|
-
let maxUsed = 0;
|
|
229
|
-
let maxWeight = 0;
|
|
230
|
-
|
|
231
|
-
for (const [key, [usedCount, weight]] of indents) {
|
|
232
|
-
if (usedCount > maxUsed || (usedCount === maxUsed && weight > maxWeight)) {
|
|
233
|
-
maxUsed = usedCount;
|
|
234
|
-
maxWeight = weight;
|
|
235
|
-
result = key;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return result;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function makeIndentString(type, amount) {
|
|
243
|
-
const indentCharacter = type === INDENT_TYPE_SPACE ? ' ' : '\t';
|
|
244
|
-
return indentCharacter.repeat(amount);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
module.exports = string => {
|
|
248
|
-
if (typeof string !== 'string') {
|
|
249
|
-
throw new TypeError('Expected a string');
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// Identify indents while skipping single space indents to avoid common edge cases (e.g. code comments)
|
|
253
|
-
// If no indents are identified, run again and include all indents for comprehensive detection
|
|
254
|
-
let indents = makeIndentsMap(string, true);
|
|
255
|
-
if (indents.size === 0) {
|
|
256
|
-
indents = makeIndentsMap(string, false);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
const keyOfMostUsedIndent = getMostUsedKey(indents);
|
|
260
|
-
|
|
261
|
-
let type;
|
|
262
|
-
let amount = 0;
|
|
263
|
-
let indent = '';
|
|
264
|
-
|
|
265
|
-
if (keyOfMostUsedIndent !== undefined) {
|
|
266
|
-
({type, amount} = decodeIndentsKey(keyOfMostUsedIndent));
|
|
267
|
-
indent = makeIndentString(type, amount);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return {
|
|
271
|
-
amount,
|
|
272
|
-
type,
|
|
273
|
-
indent
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
/***/ }),
|
|
279
|
-
/* 4 */
|
|
280
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
281
|
-
|
|
282
|
-
"use strict";
|
|
283
|
-
|
|
284
|
-
/*---------------------------------------------------------------------------------------------
|
|
285
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
286
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
287
|
-
*--------------------------------------------------------------------------------------------*/
|
|
288
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
289
|
-
exports.JUPYTER_NOTEBOOK_MARKDOWN_SELECTOR = exports.ATTACHMENT_CLEANUP_COMMANDID = exports.defaultNotebookFormat = void 0;
|
|
290
|
-
exports.defaultNotebookFormat = { major: 4, minor: 2 };
|
|
291
|
-
exports.ATTACHMENT_CLEANUP_COMMANDID = 'ipynb.cleanInvalidImageAttachment';
|
|
292
|
-
exports.JUPYTER_NOTEBOOK_MARKDOWN_SELECTOR = { notebookType: 'jupyter-notebook', language: 'markdown' };
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
/***/ }),
|
|
296
|
-
/* 5 */
|
|
297
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
298
|
-
|
|
299
|
-
"use strict";
|
|
300
|
-
|
|
301
|
-
/*---------------------------------------------------------------------------------------------
|
|
302
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
303
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
304
|
-
*--------------------------------------------------------------------------------------------*/
|
|
305
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
306
|
-
exports.jupyterNotebookModelToNotebookData = exports.jupyterCellOutputToCellOutput = exports.textMimeTypes = exports.getPreferredLanguage = void 0;
|
|
307
|
-
const vscode_1 = __webpack_require__(1);
|
|
308
|
-
const jupyterLanguageToMonacoLanguageMapping = new Map([
|
|
309
|
-
['c#', 'csharp'],
|
|
310
|
-
['f#', 'fsharp'],
|
|
311
|
-
['q#', 'qsharp'],
|
|
312
|
-
['c++11', 'c++'],
|
|
313
|
-
['c++12', 'c++'],
|
|
314
|
-
['c++14', 'c++']
|
|
315
|
-
]);
|
|
316
|
-
function getPreferredLanguage(metadata) {
|
|
317
|
-
const jupyterLanguage = metadata?.language_info?.name ||
|
|
318
|
-
metadata?.kernelspec?.language;
|
|
319
|
-
// Default to python language only if the Python extension is installed.
|
|
320
|
-
const defaultLanguage = vscode_1.extensions.getExtension('ms-python.python')
|
|
321
|
-
? 'python'
|
|
322
|
-
: (vscode_1.extensions.getExtension('ms-dotnettools.dotnet-interactive-vscode') ? 'csharp' : 'python');
|
|
323
|
-
// Note, whatever language is returned here, when the user selects a kernel, the cells (of blank documents) get updated based on that kernel selection.
|
|
324
|
-
return translateKernelLanguageToMonaco(jupyterLanguage || defaultLanguage);
|
|
325
|
-
}
|
|
326
|
-
exports.getPreferredLanguage = getPreferredLanguage;
|
|
327
|
-
function translateKernelLanguageToMonaco(language) {
|
|
328
|
-
language = language.toLowerCase();
|
|
329
|
-
if (language.length === 2 && language.endsWith('#')) {
|
|
330
|
-
return `${language.substring(0, 1)}sharp`;
|
|
331
|
-
}
|
|
332
|
-
return jupyterLanguageToMonacoLanguageMapping.get(language) || language;
|
|
333
|
-
}
|
|
334
|
-
const orderOfMimeTypes = [
|
|
335
|
-
'application/vnd.*',
|
|
336
|
-
'application/vdom.*',
|
|
337
|
-
'application/geo+json',
|
|
338
|
-
'application/x-nteract-model-debug+json',
|
|
339
|
-
'text/html',
|
|
340
|
-
'application/javascript',
|
|
341
|
-
'image/gif',
|
|
342
|
-
'text/latex',
|
|
343
|
-
'text/markdown',
|
|
344
|
-
'image/png',
|
|
345
|
-
'image/svg+xml',
|
|
346
|
-
'image/jpeg',
|
|
347
|
-
'application/json',
|
|
348
|
-
'text/plain'
|
|
349
|
-
];
|
|
350
|
-
function isEmptyVendoredMimeType(outputItem) {
|
|
351
|
-
if (outputItem.mime.startsWith('application/vnd.')) {
|
|
352
|
-
try {
|
|
353
|
-
return outputItem.data.byteLength === 0 || Buffer.from(outputItem.data).toString().length === 0;
|
|
354
|
-
}
|
|
355
|
-
catch { }
|
|
356
|
-
}
|
|
357
|
-
return false;
|
|
358
|
-
}
|
|
359
|
-
function isMimeTypeMatch(value, compareWith) {
|
|
360
|
-
if (value.endsWith('.*')) {
|
|
361
|
-
value = value.substr(0, value.indexOf('.*'));
|
|
362
|
-
}
|
|
363
|
-
return compareWith.startsWith(value);
|
|
364
|
-
}
|
|
365
|
-
function sortOutputItemsBasedOnDisplayOrder(outputItems) {
|
|
366
|
-
return outputItems
|
|
367
|
-
.map(item => {
|
|
368
|
-
let index = orderOfMimeTypes.findIndex((mime) => isMimeTypeMatch(mime, item.mime));
|
|
369
|
-
// Sometimes we can have mime types with empty data, e.g. when using holoview we can have `application/vnd.holoviews_load.v0+json` with empty value.
|
|
370
|
-
// & in these cases we have HTML/JS and those take precedence.
|
|
371
|
-
// https://github.com/microsoft/vscode-jupyter/issues/6109
|
|
372
|
-
if (isEmptyVendoredMimeType(item)) {
|
|
373
|
-
index = -1;
|
|
374
|
-
}
|
|
375
|
-
index = index === -1 ? 100 : index;
|
|
376
|
-
return {
|
|
377
|
-
item, index
|
|
378
|
-
};
|
|
379
|
-
})
|
|
380
|
-
.sort((outputItemA, outputItemB) => outputItemA.index - outputItemB.index).map(item => item.item);
|
|
381
|
-
}
|
|
382
|
-
var CellOutputMimeTypes;
|
|
383
|
-
(function (CellOutputMimeTypes) {
|
|
384
|
-
CellOutputMimeTypes["error"] = "application/vnd.code.notebook.error";
|
|
385
|
-
CellOutputMimeTypes["stderr"] = "application/vnd.code.notebook.stderr";
|
|
386
|
-
CellOutputMimeTypes["stdout"] = "application/vnd.code.notebook.stdout";
|
|
387
|
-
})(CellOutputMimeTypes || (CellOutputMimeTypes = {}));
|
|
388
|
-
exports.textMimeTypes = ['text/plain', 'text/markdown', 'text/latex', CellOutputMimeTypes.stderr, CellOutputMimeTypes.stdout];
|
|
389
|
-
function concatMultilineString(str, trim) {
|
|
390
|
-
const nonLineFeedWhiteSpaceTrim = /(^[\t\f\v\r ]+|[\t\f\v\r ]+$)/g;
|
|
391
|
-
if (Array.isArray(str)) {
|
|
392
|
-
let result = '';
|
|
393
|
-
for (let i = 0; i < str.length; i += 1) {
|
|
394
|
-
const s = str[i];
|
|
395
|
-
if (i < str.length - 1 && !s.endsWith('\n')) {
|
|
396
|
-
result = result.concat(`${s}\n`);
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
result = result.concat(s);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
// Just trim whitespace. Leave \n in place
|
|
403
|
-
return trim ? result.replace(nonLineFeedWhiteSpaceTrim, '') : result;
|
|
404
|
-
}
|
|
405
|
-
return trim ? str.toString().replace(nonLineFeedWhiteSpaceTrim, '') : str.toString();
|
|
406
|
-
}
|
|
407
|
-
function convertJupyterOutputToBuffer(mime, value) {
|
|
408
|
-
if (!value) {
|
|
409
|
-
return vscode_1.NotebookCellOutputItem.text('', mime);
|
|
410
|
-
}
|
|
411
|
-
try {
|
|
412
|
-
if ((mime.startsWith('text/') || exports.textMimeTypes.includes(mime)) &&
|
|
413
|
-
(Array.isArray(value) || typeof value === 'string')) {
|
|
414
|
-
const stringValue = Array.isArray(value) ? concatMultilineString(value) : value;
|
|
415
|
-
return vscode_1.NotebookCellOutputItem.text(stringValue, mime);
|
|
416
|
-
}
|
|
417
|
-
else if (mime.startsWith('image/') && typeof value === 'string' && mime !== 'image/svg+xml') {
|
|
418
|
-
// Images in Jupyter are stored in base64 encoded format.
|
|
419
|
-
// VS Code expects bytes when rendering images.
|
|
420
|
-
if (typeof Buffer !== 'undefined' && typeof Buffer.from === 'function') {
|
|
421
|
-
return new vscode_1.NotebookCellOutputItem(Buffer.from(value, 'base64'), mime);
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
const data = Uint8Array.from(atob(value), c => c.charCodeAt(0));
|
|
425
|
-
return new vscode_1.NotebookCellOutputItem(data, mime);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
429
|
-
return vscode_1.NotebookCellOutputItem.text(JSON.stringify(value), mime);
|
|
430
|
-
}
|
|
431
|
-
else if (mime === 'application/json') {
|
|
432
|
-
return vscode_1.NotebookCellOutputItem.json(value, mime);
|
|
433
|
-
}
|
|
434
|
-
else {
|
|
435
|
-
// For everything else, treat the data as strings (or multi-line strings).
|
|
436
|
-
value = Array.isArray(value) ? concatMultilineString(value) : value;
|
|
437
|
-
return vscode_1.NotebookCellOutputItem.text(value, mime);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
catch (ex) {
|
|
441
|
-
return vscode_1.NotebookCellOutputItem.error(ex);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
function getNotebookCellMetadata(cell) {
|
|
445
|
-
const cellMetadata = {};
|
|
446
|
-
// We put this only for VSC to display in diff view.
|
|
447
|
-
// Else we don't use this.
|
|
448
|
-
const custom = {};
|
|
449
|
-
if (cell['metadata']) {
|
|
450
|
-
custom['metadata'] = JSON.parse(JSON.stringify(cell['metadata']));
|
|
451
|
-
}
|
|
452
|
-
if ('id' in cell && typeof cell.id === 'string') {
|
|
453
|
-
custom.id = cell.id;
|
|
454
|
-
}
|
|
455
|
-
cellMetadata.custom = custom;
|
|
456
|
-
if (cell['attachments']) {
|
|
457
|
-
cellMetadata.attachments = JSON.parse(JSON.stringify(cell['attachments']));
|
|
458
|
-
}
|
|
459
|
-
return cellMetadata;
|
|
460
|
-
}
|
|
461
|
-
function getOutputMetadata(output) {
|
|
462
|
-
// Add on transient data if we have any. This should be removed by our save functions elsewhere.
|
|
463
|
-
const metadata = {
|
|
464
|
-
outputType: output.output_type
|
|
465
|
-
};
|
|
466
|
-
if (output.transient) {
|
|
467
|
-
metadata.transient = output.transient;
|
|
468
|
-
}
|
|
469
|
-
switch (output.output_type) {
|
|
470
|
-
case 'display_data':
|
|
471
|
-
case 'execute_result':
|
|
472
|
-
case 'update_display_data': {
|
|
473
|
-
metadata.executionCount = output.execution_count;
|
|
474
|
-
metadata.metadata = output.metadata ? JSON.parse(JSON.stringify(output.metadata)) : {};
|
|
475
|
-
break;
|
|
476
|
-
}
|
|
477
|
-
default:
|
|
478
|
-
break;
|
|
479
|
-
}
|
|
480
|
-
return metadata;
|
|
481
|
-
}
|
|
482
|
-
function translateDisplayDataOutput(output) {
|
|
483
|
-
// Metadata could be as follows:
|
|
484
|
-
// We'll have metadata specific to each mime type as well as generic metadata.
|
|
485
|
-
/*
|
|
486
|
-
IDisplayData = {
|
|
487
|
-
output_type: 'display_data',
|
|
488
|
-
data: {
|
|
489
|
-
'image/jpg': '/////'
|
|
490
|
-
'image/png': '/////'
|
|
491
|
-
'text/plain': '/////'
|
|
492
|
-
},
|
|
493
|
-
metadata: {
|
|
494
|
-
'image/png': '/////',
|
|
495
|
-
'background': true,
|
|
496
|
-
'xyz': '///
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
*/
|
|
500
|
-
const metadata = getOutputMetadata(output);
|
|
501
|
-
const items = [];
|
|
502
|
-
if (output.data) {
|
|
503
|
-
for (const key in output.data) {
|
|
504
|
-
items.push(convertJupyterOutputToBuffer(key, output.data[key]));
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
return new vscode_1.NotebookCellOutput(sortOutputItemsBasedOnDisplayOrder(items), metadata);
|
|
508
|
-
}
|
|
509
|
-
function translateErrorOutput(output) {
|
|
510
|
-
output = output || { output_type: 'error', ename: '', evalue: '', traceback: [] };
|
|
511
|
-
return new vscode_1.NotebookCellOutput([
|
|
512
|
-
vscode_1.NotebookCellOutputItem.error({
|
|
513
|
-
name: output?.ename || '',
|
|
514
|
-
message: output?.evalue || '',
|
|
515
|
-
stack: (output?.traceback || []).join('\n')
|
|
516
|
-
})
|
|
517
|
-
], { ...getOutputMetadata(output), originalError: output });
|
|
518
|
-
}
|
|
519
|
-
function translateStreamOutput(output) {
|
|
520
|
-
const value = concatMultilineString(output.text);
|
|
521
|
-
const item = output.name === 'stderr' ? vscode_1.NotebookCellOutputItem.stderr(value) : vscode_1.NotebookCellOutputItem.stdout(value);
|
|
522
|
-
return new vscode_1.NotebookCellOutput([item], getOutputMetadata(output));
|
|
523
|
-
}
|
|
524
|
-
const cellOutputMappers = new Map();
|
|
525
|
-
cellOutputMappers.set('display_data', translateDisplayDataOutput);
|
|
526
|
-
cellOutputMappers.set('execute_result', translateDisplayDataOutput);
|
|
527
|
-
cellOutputMappers.set('update_display_data', translateDisplayDataOutput);
|
|
528
|
-
cellOutputMappers.set('error', translateErrorOutput);
|
|
529
|
-
cellOutputMappers.set('stream', translateStreamOutput);
|
|
530
|
-
function jupyterCellOutputToCellOutput(output) {
|
|
531
|
-
/**
|
|
532
|
-
* Stream, `application/x.notebook.stream`
|
|
533
|
-
* Error, `application/x.notebook.error-traceback`
|
|
534
|
-
* Rich, { mime: value }
|
|
535
|
-
*
|
|
536
|
-
* outputs: [
|
|
537
|
-
new vscode.NotebookCellOutput([
|
|
538
|
-
new vscode.NotebookCellOutputItem('application/x.notebook.stream', 2),
|
|
539
|
-
new vscode.NotebookCellOutputItem('application/x.notebook.stream', 3),
|
|
540
|
-
]),
|
|
541
|
-
new vscode.NotebookCellOutput([
|
|
542
|
-
new vscode.NotebookCellOutputItem('text/markdown', '## header 2'),
|
|
543
|
-
new vscode.NotebookCellOutputItem('image/svg+xml', [
|
|
544
|
-
"<svg baseProfile=\"full\" height=\"200\" version=\"1.1\" width=\"300\" xmlns=\"http://www.w3.org/2000/svg\">\n",
|
|
545
|
-
" <rect fill=\"blue\" height=\"100%\" width=\"100%\"/>\n",
|
|
546
|
-
" <circle cx=\"150\" cy=\"100\" fill=\"green\" r=\"80\"/>\n",
|
|
547
|
-
" <text fill=\"white\" font-size=\"60\" text-anchor=\"middle\" x=\"150\" y=\"125\">SVG</text>\n",
|
|
548
|
-
"</svg>"
|
|
549
|
-
]),
|
|
550
|
-
]),
|
|
551
|
-
]
|
|
552
|
-
*
|
|
553
|
-
*/
|
|
554
|
-
const fn = cellOutputMappers.get(output.output_type);
|
|
555
|
-
let result;
|
|
556
|
-
if (fn) {
|
|
557
|
-
result = fn(output);
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
result = translateDisplayDataOutput(output);
|
|
561
|
-
}
|
|
562
|
-
return result;
|
|
563
|
-
}
|
|
564
|
-
exports.jupyterCellOutputToCellOutput = jupyterCellOutputToCellOutput;
|
|
565
|
-
function createNotebookCellDataFromRawCell(cell) {
|
|
566
|
-
const cellData = new vscode_1.NotebookCellData(vscode_1.NotebookCellKind.Code, concatMultilineString(cell.source), 'raw');
|
|
567
|
-
cellData.outputs = [];
|
|
568
|
-
cellData.metadata = getNotebookCellMetadata(cell);
|
|
569
|
-
return cellData;
|
|
570
|
-
}
|
|
571
|
-
function createNotebookCellDataFromMarkdownCell(cell) {
|
|
572
|
-
const cellData = new vscode_1.NotebookCellData(vscode_1.NotebookCellKind.Markup, concatMultilineString(cell.source), 'markdown');
|
|
573
|
-
cellData.outputs = [];
|
|
574
|
-
cellData.metadata = getNotebookCellMetadata(cell);
|
|
575
|
-
return cellData;
|
|
576
|
-
}
|
|
577
|
-
function createNotebookCellDataFromCodeCell(cell, cellLanguage) {
|
|
578
|
-
const cellOutputs = Array.isArray(cell.outputs) ? cell.outputs : [];
|
|
579
|
-
const outputs = cellOutputs.map(jupyterCellOutputToCellOutput);
|
|
580
|
-
const hasExecutionCount = typeof cell.execution_count === 'number' && cell.execution_count > 0;
|
|
581
|
-
const source = concatMultilineString(cell.source);
|
|
582
|
-
const executionSummary = hasExecutionCount
|
|
583
|
-
? { executionOrder: cell.execution_count }
|
|
584
|
-
: {};
|
|
585
|
-
const vscodeCustomMetadata = cell.metadata['vscode'];
|
|
586
|
-
const cellLanguageId = vscodeCustomMetadata && vscodeCustomMetadata.languageId && typeof vscodeCustomMetadata.languageId === 'string' ? vscodeCustomMetadata.languageId : cellLanguage;
|
|
587
|
-
const cellData = new vscode_1.NotebookCellData(vscode_1.NotebookCellKind.Code, source, cellLanguageId);
|
|
588
|
-
cellData.outputs = outputs;
|
|
589
|
-
cellData.metadata = getNotebookCellMetadata(cell);
|
|
590
|
-
cellData.executionSummary = executionSummary;
|
|
591
|
-
return cellData;
|
|
592
|
-
}
|
|
593
|
-
function createNotebookCellDataFromJupyterCell(cellLanguage, cell) {
|
|
594
|
-
switch (cell.cell_type) {
|
|
595
|
-
case 'raw': {
|
|
596
|
-
return createNotebookCellDataFromRawCell(cell);
|
|
597
|
-
}
|
|
598
|
-
case 'markdown': {
|
|
599
|
-
return createNotebookCellDataFromMarkdownCell(cell);
|
|
600
|
-
}
|
|
601
|
-
case 'code': {
|
|
602
|
-
return createNotebookCellDataFromCodeCell(cell, cellLanguage);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
/**
|
|
608
|
-
* Converts a NotebookModel into VS Code format.
|
|
609
|
-
*/
|
|
610
|
-
function jupyterNotebookModelToNotebookData(notebookContent, preferredLanguage) {
|
|
611
|
-
const notebookContentWithoutCells = { ...notebookContent, cells: [] };
|
|
612
|
-
if (!notebookContent.cells || notebookContent.cells.length === 0) {
|
|
613
|
-
throw new Error('Notebook content is missing cells');
|
|
614
|
-
}
|
|
615
|
-
const cells = notebookContent.cells
|
|
616
|
-
.map(cell => createNotebookCellDataFromJupyterCell(preferredLanguage, cell))
|
|
617
|
-
.filter((item) => !!item);
|
|
618
|
-
const notebookData = new vscode_1.NotebookData(cells);
|
|
619
|
-
notebookData.metadata = { custom: notebookContentWithoutCells };
|
|
620
|
-
return notebookData;
|
|
621
|
-
}
|
|
622
|
-
exports.jupyterNotebookModelToNotebookData = jupyterNotebookModelToNotebookData;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
/***/ }),
|
|
626
|
-
/* 6 */
|
|
627
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
628
|
-
|
|
629
|
-
"use strict";
|
|
630
|
-
|
|
631
|
-
/*---------------------------------------------------------------------------------------------
|
|
632
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
633
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
634
|
-
*--------------------------------------------------------------------------------------------*/
|
|
635
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
636
|
-
exports.pruneCell = exports.createMarkdownCellFromNotebookCell = exports.getCellMetadata = exports.sortObjectPropertiesRecursively = exports.createJupyterCellFromNotebookCell = void 0;
|
|
637
|
-
const vscode_1 = __webpack_require__(1);
|
|
638
|
-
const deserializers_1 = __webpack_require__(5);
|
|
639
|
-
const textDecoder = new TextDecoder();
|
|
640
|
-
var CellOutputMimeTypes;
|
|
641
|
-
(function (CellOutputMimeTypes) {
|
|
642
|
-
CellOutputMimeTypes["error"] = "application/vnd.code.notebook.error";
|
|
643
|
-
CellOutputMimeTypes["stderr"] = "application/vnd.code.notebook.stderr";
|
|
644
|
-
CellOutputMimeTypes["stdout"] = "application/vnd.code.notebook.stdout";
|
|
645
|
-
})(CellOutputMimeTypes || (CellOutputMimeTypes = {}));
|
|
646
|
-
function createJupyterCellFromNotebookCell(vscCell, preferredLanguage) {
|
|
647
|
-
let cell;
|
|
648
|
-
if (vscCell.kind === vscode_1.NotebookCellKind.Markup) {
|
|
649
|
-
cell = createMarkdownCellFromNotebookCell(vscCell);
|
|
650
|
-
}
|
|
651
|
-
else if (vscCell.languageId === 'raw') {
|
|
652
|
-
cell = createRawCellFromNotebookCell(vscCell);
|
|
653
|
-
}
|
|
654
|
-
else {
|
|
655
|
-
cell = createCodeCellFromNotebookCell(vscCell, preferredLanguage);
|
|
656
|
-
}
|
|
657
|
-
return cell;
|
|
658
|
-
}
|
|
659
|
-
exports.createJupyterCellFromNotebookCell = createJupyterCellFromNotebookCell;
|
|
660
|
-
/**
|
|
661
|
-
* Sort the JSON to minimize unnecessary SCM changes.
|
|
662
|
-
* Jupyter notbeooks/labs sorts the JSON keys in alphabetical order.
|
|
663
|
-
* https://github.com/microsoft/vscode-python/issues/13155
|
|
664
|
-
*/
|
|
665
|
-
function sortObjectPropertiesRecursively(obj) {
|
|
666
|
-
if (Array.isArray(obj)) {
|
|
667
|
-
return obj.map(sortObjectPropertiesRecursively);
|
|
668
|
-
}
|
|
669
|
-
if (obj !== undefined && obj !== null && typeof obj === 'object' && Object.keys(obj).length > 0) {
|
|
670
|
-
return Object.keys(obj)
|
|
671
|
-
.sort()
|
|
672
|
-
.reduce((sortedObj, prop) => {
|
|
673
|
-
sortedObj[prop] = sortObjectPropertiesRecursively(obj[prop]);
|
|
674
|
-
return sortedObj;
|
|
675
|
-
}, {});
|
|
676
|
-
}
|
|
677
|
-
return obj;
|
|
678
|
-
}
|
|
679
|
-
exports.sortObjectPropertiesRecursively = sortObjectPropertiesRecursively;
|
|
680
|
-
function getCellMetadata(cell) {
|
|
681
|
-
return {
|
|
682
|
-
// it contains the cell id, and the cell metadata, along with other nb cell metadata
|
|
683
|
-
...(cell.metadata?.custom ?? {}),
|
|
684
|
-
// promote the cell attachments to the top level
|
|
685
|
-
attachments: cell.metadata?.custom?.attachments ?? cell.metadata?.attachments
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
exports.getCellMetadata = getCellMetadata;
|
|
689
|
-
function createCodeCellFromNotebookCell(cell, preferredLanguage) {
|
|
690
|
-
const cellMetadata = getCellMetadata(cell);
|
|
691
|
-
let metadata = cellMetadata?.metadata || {}; // This cannot be empty.
|
|
692
|
-
if (cell.languageId !== preferredLanguage) {
|
|
693
|
-
metadata = {
|
|
694
|
-
...metadata,
|
|
695
|
-
vscode: {
|
|
696
|
-
languageId: cell.languageId
|
|
697
|
-
}
|
|
698
|
-
};
|
|
699
|
-
}
|
|
700
|
-
else {
|
|
701
|
-
// cell current language is the same as the preferred cell language in the document, flush the vscode custom language id metadata
|
|
702
|
-
metadata.vscode = undefined;
|
|
703
|
-
}
|
|
704
|
-
const codeCell = {
|
|
705
|
-
cell_type: 'code',
|
|
706
|
-
execution_count: cell.executionSummary?.executionOrder ?? null,
|
|
707
|
-
source: splitMultilineString(cell.value.replace(/\r\n/g, '\n')),
|
|
708
|
-
outputs: (cell.outputs || []).map(translateCellDisplayOutput),
|
|
709
|
-
metadata: metadata
|
|
710
|
-
};
|
|
711
|
-
if (cellMetadata?.id) {
|
|
712
|
-
codeCell.id = cellMetadata.id;
|
|
713
|
-
}
|
|
714
|
-
return codeCell;
|
|
715
|
-
}
|
|
716
|
-
function createRawCellFromNotebookCell(cell) {
|
|
717
|
-
const cellMetadata = getCellMetadata(cell);
|
|
718
|
-
const rawCell = {
|
|
719
|
-
cell_type: 'raw',
|
|
720
|
-
source: splitMultilineString(cell.value.replace(/\r\n/g, '\n')),
|
|
721
|
-
metadata: cellMetadata?.metadata || {} // This cannot be empty.
|
|
722
|
-
};
|
|
723
|
-
if (cellMetadata?.attachments) {
|
|
724
|
-
rawCell.attachments = cellMetadata.attachments;
|
|
725
|
-
}
|
|
726
|
-
if (cellMetadata?.id) {
|
|
727
|
-
rawCell.id = cellMetadata.id;
|
|
728
|
-
}
|
|
729
|
-
return rawCell;
|
|
730
|
-
}
|
|
731
|
-
function splitMultilineString(source) {
|
|
732
|
-
if (Array.isArray(source)) {
|
|
733
|
-
return source;
|
|
734
|
-
}
|
|
735
|
-
const str = source.toString();
|
|
736
|
-
if (str.length > 0) {
|
|
737
|
-
// Each line should be a separate entry, but end with a \n if not last entry
|
|
738
|
-
const arr = str.split('\n');
|
|
739
|
-
return arr
|
|
740
|
-
.map((s, i) => {
|
|
741
|
-
if (i < arr.length - 1) {
|
|
742
|
-
return `${s}\n`;
|
|
743
|
-
}
|
|
744
|
-
return s;
|
|
745
|
-
})
|
|
746
|
-
.filter(s => s.length > 0); // Skip last one if empty (it's the only one that could be length 0)
|
|
747
|
-
}
|
|
748
|
-
return [];
|
|
749
|
-
}
|
|
750
|
-
function translateCellDisplayOutput(output) {
|
|
751
|
-
const customMetadata = output.metadata;
|
|
752
|
-
let result;
|
|
753
|
-
// Possible some other extension added some output (do best effort to translate & save in ipynb).
|
|
754
|
-
// In which case metadata might not contain `outputType`.
|
|
755
|
-
const outputType = customMetadata?.outputType;
|
|
756
|
-
switch (outputType) {
|
|
757
|
-
case 'error': {
|
|
758
|
-
result = translateCellErrorOutput(output);
|
|
759
|
-
break;
|
|
760
|
-
}
|
|
761
|
-
case 'stream': {
|
|
762
|
-
result = convertStreamOutput(output);
|
|
763
|
-
break;
|
|
764
|
-
}
|
|
765
|
-
case 'display_data': {
|
|
766
|
-
result = {
|
|
767
|
-
output_type: 'display_data',
|
|
768
|
-
data: output.items.reduce((prev, curr) => {
|
|
769
|
-
prev[curr.mime] = convertOutputMimeToJupyterOutput(curr.mime, curr.data);
|
|
770
|
-
return prev;
|
|
771
|
-
}, {}),
|
|
772
|
-
metadata: customMetadata?.metadata || {} // This can never be undefined.
|
|
773
|
-
};
|
|
774
|
-
break;
|
|
775
|
-
}
|
|
776
|
-
case 'execute_result': {
|
|
777
|
-
result = {
|
|
778
|
-
output_type: 'execute_result',
|
|
779
|
-
data: output.items.reduce((prev, curr) => {
|
|
780
|
-
prev[curr.mime] = convertOutputMimeToJupyterOutput(curr.mime, curr.data);
|
|
781
|
-
return prev;
|
|
782
|
-
}, {}),
|
|
783
|
-
metadata: customMetadata?.metadata || {}, // This can never be undefined.
|
|
784
|
-
execution_count: typeof customMetadata?.executionCount === 'number' ? customMetadata?.executionCount : null // This can never be undefined, only a number or `null`.
|
|
785
|
-
};
|
|
786
|
-
break;
|
|
787
|
-
}
|
|
788
|
-
case 'update_display_data': {
|
|
789
|
-
result = {
|
|
790
|
-
output_type: 'update_display_data',
|
|
791
|
-
data: output.items.reduce((prev, curr) => {
|
|
792
|
-
prev[curr.mime] = convertOutputMimeToJupyterOutput(curr.mime, curr.data);
|
|
793
|
-
return prev;
|
|
794
|
-
}, {}),
|
|
795
|
-
metadata: customMetadata?.metadata || {} // This can never be undefined.
|
|
796
|
-
};
|
|
797
|
-
break;
|
|
798
|
-
}
|
|
799
|
-
default: {
|
|
800
|
-
const isError = output.items.length === 1 && output.items.every((item) => item.mime === CellOutputMimeTypes.error);
|
|
801
|
-
const isStream = output.items.every((item) => item.mime === CellOutputMimeTypes.stderr || item.mime === CellOutputMimeTypes.stdout);
|
|
802
|
-
if (isError) {
|
|
803
|
-
return translateCellErrorOutput(output);
|
|
804
|
-
}
|
|
805
|
-
// In the case of .NET & other kernels, we need to ensure we save ipynb correctly.
|
|
806
|
-
// Hence if we have stream output, save the output as Jupyter `stream` else `display_data`
|
|
807
|
-
// Unless we already know its an unknown output type.
|
|
808
|
-
const outputType = customMetadata?.outputType || (isStream ? 'stream' : 'display_data');
|
|
809
|
-
let unknownOutput;
|
|
810
|
-
if (outputType === 'stream') {
|
|
811
|
-
// If saving as `stream` ensure the mandatory properties are set.
|
|
812
|
-
unknownOutput = convertStreamOutput(output);
|
|
813
|
-
}
|
|
814
|
-
else if (outputType === 'display_data') {
|
|
815
|
-
// If saving as `display_data` ensure the mandatory properties are set.
|
|
816
|
-
const displayData = {
|
|
817
|
-
data: {},
|
|
818
|
-
metadata: {},
|
|
819
|
-
output_type: 'display_data'
|
|
820
|
-
};
|
|
821
|
-
unknownOutput = displayData;
|
|
822
|
-
}
|
|
823
|
-
else {
|
|
824
|
-
unknownOutput = {
|
|
825
|
-
output_type: outputType
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
if (customMetadata?.metadata) {
|
|
829
|
-
unknownOutput.metadata = customMetadata.metadata;
|
|
830
|
-
}
|
|
831
|
-
if (output.items.length > 0) {
|
|
832
|
-
unknownOutput.data = output.items.reduce((prev, curr) => {
|
|
833
|
-
prev[curr.mime] = convertOutputMimeToJupyterOutput(curr.mime, curr.data);
|
|
834
|
-
return prev;
|
|
835
|
-
}, {});
|
|
836
|
-
}
|
|
837
|
-
result = unknownOutput;
|
|
838
|
-
break;
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
// Account for transient data as well
|
|
842
|
-
// `transient.display_id` is used to update cell output in other cells, at least thats one use case we know of.
|
|
843
|
-
if (result && customMetadata && customMetadata.transient) {
|
|
844
|
-
result.transient = customMetadata.transient;
|
|
845
|
-
}
|
|
846
|
-
return result;
|
|
847
|
-
}
|
|
848
|
-
function translateCellErrorOutput(output) {
|
|
849
|
-
// it should have at least one output item
|
|
850
|
-
const firstItem = output.items[0];
|
|
851
|
-
// Bug in VS Code.
|
|
852
|
-
if (!firstItem.data) {
|
|
853
|
-
return {
|
|
854
|
-
output_type: 'error',
|
|
855
|
-
ename: '',
|
|
856
|
-
evalue: '',
|
|
857
|
-
traceback: []
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
const originalError = output.metadata?.originalError;
|
|
861
|
-
const value = JSON.parse(textDecoder.decode(firstItem.data));
|
|
862
|
-
return {
|
|
863
|
-
output_type: 'error',
|
|
864
|
-
ename: value.name,
|
|
865
|
-
evalue: value.message,
|
|
866
|
-
// VS Code needs an `Error` object which requires a `stack` property as a string.
|
|
867
|
-
// Its possible the format could change when converting from `traceback` to `string` and back again to `string`
|
|
868
|
-
// When .NET stores errors in output (with their .NET kernel),
|
|
869
|
-
// stack is empty, hence store the message instead of stack (so that somethign gets displayed in ipynb).
|
|
870
|
-
traceback: originalError?.traceback || splitMultilineString(value.stack || value.message || '')
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
function getOutputStreamType(output) {
|
|
874
|
-
if (output.items.length > 0) {
|
|
875
|
-
return output.items[0].mime === CellOutputMimeTypes.stderr ? 'stderr' : 'stdout';
|
|
876
|
-
}
|
|
877
|
-
return;
|
|
878
|
-
}
|
|
879
|
-
function convertStreamOutput(output) {
|
|
880
|
-
const outputs = [];
|
|
881
|
-
output.items
|
|
882
|
-
.filter((opit) => opit.mime === CellOutputMimeTypes.stderr || opit.mime === CellOutputMimeTypes.stdout)
|
|
883
|
-
.map((opit) => textDecoder.decode(opit.data))
|
|
884
|
-
.forEach(value => {
|
|
885
|
-
// Ensure each line is a separate entry in an array (ending with \n).
|
|
886
|
-
const lines = value.split('\n');
|
|
887
|
-
// If the last item in `outputs` is not empty and the first item in `lines` is not empty, then concate them.
|
|
888
|
-
// As they are part of the same line.
|
|
889
|
-
if (outputs.length && lines.length && lines[0].length > 0) {
|
|
890
|
-
outputs[outputs.length - 1] = `${outputs[outputs.length - 1]}${lines.shift()}`;
|
|
891
|
-
}
|
|
892
|
-
for (const line of lines) {
|
|
893
|
-
outputs.push(line);
|
|
894
|
-
}
|
|
895
|
-
});
|
|
896
|
-
for (let index = 0; index < (outputs.length - 1); index++) {
|
|
897
|
-
outputs[index] = `${outputs[index]}\n`;
|
|
898
|
-
}
|
|
899
|
-
// Skip last one if empty (it's the only one that could be length 0)
|
|
900
|
-
if (outputs.length && outputs[outputs.length - 1].length === 0) {
|
|
901
|
-
outputs.pop();
|
|
902
|
-
}
|
|
903
|
-
const streamType = getOutputStreamType(output) || 'stdout';
|
|
904
|
-
return {
|
|
905
|
-
output_type: 'stream',
|
|
906
|
-
name: streamType,
|
|
907
|
-
text: outputs
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
function convertOutputMimeToJupyterOutput(mime, value) {
|
|
911
|
-
if (!value) {
|
|
912
|
-
return '';
|
|
913
|
-
}
|
|
914
|
-
try {
|
|
915
|
-
if (mime === CellOutputMimeTypes.error) {
|
|
916
|
-
const stringValue = textDecoder.decode(value);
|
|
917
|
-
return JSON.parse(stringValue);
|
|
918
|
-
}
|
|
919
|
-
else if (mime.startsWith('text/') || deserializers_1.textMimeTypes.includes(mime)) {
|
|
920
|
-
const stringValue = textDecoder.decode(value);
|
|
921
|
-
return splitMultilineString(stringValue);
|
|
922
|
-
}
|
|
923
|
-
else if (mime.startsWith('image/') && mime !== 'image/svg+xml') {
|
|
924
|
-
// Images in Jupyter are stored in base64 encoded format.
|
|
925
|
-
// VS Code expects bytes when rendering images.
|
|
926
|
-
if (typeof Buffer !== 'undefined' && typeof Buffer.from === 'function') {
|
|
927
|
-
return Buffer.from(value).toString('base64');
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
return btoa(value.reduce((s, b) => s + String.fromCharCode(b), ''));
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
else if (mime.toLowerCase().includes('json')) {
|
|
934
|
-
const stringValue = textDecoder.decode(value);
|
|
935
|
-
return stringValue.length > 0 ? JSON.parse(stringValue) : stringValue;
|
|
936
|
-
}
|
|
937
|
-
else if (mime === 'image/svg+xml') {
|
|
938
|
-
return splitMultilineString(textDecoder.decode(value));
|
|
939
|
-
}
|
|
940
|
-
else {
|
|
941
|
-
return textDecoder.decode(value);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
catch (ex) {
|
|
945
|
-
return '';
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
function createMarkdownCellFromNotebookCell(cell) {
|
|
949
|
-
const cellMetadata = getCellMetadata(cell);
|
|
950
|
-
const markdownCell = {
|
|
951
|
-
cell_type: 'markdown',
|
|
952
|
-
source: splitMultilineString(cell.value.replace(/\r\n/g, '\n')),
|
|
953
|
-
metadata: cellMetadata?.metadata || {} // This cannot be empty.
|
|
954
|
-
};
|
|
955
|
-
if (cellMetadata?.attachments) {
|
|
956
|
-
markdownCell.attachments = cellMetadata.attachments;
|
|
957
|
-
}
|
|
958
|
-
if (cellMetadata?.id) {
|
|
959
|
-
markdownCell.id = cellMetadata.id;
|
|
960
|
-
}
|
|
961
|
-
return markdownCell;
|
|
962
|
-
}
|
|
963
|
-
exports.createMarkdownCellFromNotebookCell = createMarkdownCellFromNotebookCell;
|
|
964
|
-
function pruneCell(cell) {
|
|
965
|
-
// Source is usually a single string on input. Convert back to an array
|
|
966
|
-
const result = {
|
|
967
|
-
...cell,
|
|
968
|
-
source: splitMultilineString(cell.source)
|
|
969
|
-
};
|
|
970
|
-
// Remove outputs and execution_count from non code cells
|
|
971
|
-
if (result.cell_type !== 'code') {
|
|
972
|
-
delete result.outputs;
|
|
973
|
-
delete result.execution_count;
|
|
974
|
-
}
|
|
975
|
-
else {
|
|
976
|
-
// Clean outputs from code cells
|
|
977
|
-
result.outputs = result.outputs ? result.outputs.map(fixupOutput) : [];
|
|
978
|
-
}
|
|
979
|
-
return result;
|
|
980
|
-
}
|
|
981
|
-
exports.pruneCell = pruneCell;
|
|
982
|
-
const dummyStreamObj = {
|
|
983
|
-
output_type: 'stream',
|
|
984
|
-
name: 'stdout',
|
|
985
|
-
text: ''
|
|
986
|
-
};
|
|
987
|
-
const dummyErrorObj = {
|
|
988
|
-
output_type: 'error',
|
|
989
|
-
ename: '',
|
|
990
|
-
evalue: '',
|
|
991
|
-
traceback: ['']
|
|
992
|
-
};
|
|
993
|
-
const dummyDisplayObj = {
|
|
994
|
-
output_type: 'display_data',
|
|
995
|
-
data: {},
|
|
996
|
-
metadata: {}
|
|
997
|
-
};
|
|
998
|
-
const dummyExecuteResultObj = {
|
|
999
|
-
output_type: 'execute_result',
|
|
1000
|
-
name: '',
|
|
1001
|
-
execution_count: 0,
|
|
1002
|
-
data: {},
|
|
1003
|
-
metadata: {}
|
|
1004
|
-
};
|
|
1005
|
-
const AllowedCellOutputKeys = {
|
|
1006
|
-
['stream']: new Set(Object.keys(dummyStreamObj)),
|
|
1007
|
-
['error']: new Set(Object.keys(dummyErrorObj)),
|
|
1008
|
-
['display_data']: new Set(Object.keys(dummyDisplayObj)),
|
|
1009
|
-
['execute_result']: new Set(Object.keys(dummyExecuteResultObj))
|
|
1010
|
-
};
|
|
1011
|
-
function fixupOutput(output) {
|
|
1012
|
-
let allowedKeys;
|
|
1013
|
-
switch (output.output_type) {
|
|
1014
|
-
case 'stream':
|
|
1015
|
-
case 'error':
|
|
1016
|
-
case 'execute_result':
|
|
1017
|
-
case 'display_data':
|
|
1018
|
-
allowedKeys = AllowedCellOutputKeys[output.output_type];
|
|
1019
|
-
break;
|
|
1020
|
-
default:
|
|
1021
|
-
return output;
|
|
1022
|
-
}
|
|
1023
|
-
const result = { ...output };
|
|
1024
|
-
for (const k of Object.keys(output)) {
|
|
1025
|
-
if (!allowedKeys.has(k)) {
|
|
1026
|
-
delete result[k];
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
return result;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
/***/ }),
|
|
1034
|
-
/* 7 */
|
|
1035
|
-
/***/ ((module) => {
|
|
1036
|
-
|
|
1037
|
-
/**
|
|
1038
|
-
* FNV-1a Hash implementation (32, 64, 128, 256, 512, and 1024 bit)
|
|
1039
|
-
* @author Travis Webb <me@traviswebb.com>
|
|
1040
|
-
* @see http://tools.ietf.org/html/draft-eastlake-fnv-06
|
|
1041
|
-
*/
|
|
1042
|
-
var fnvplus = (function(){
|
|
1043
|
-
var i, hl = [], hl16 = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'],
|
|
1044
|
-
version = '1a',
|
|
1045
|
-
useUTF8 = false,
|
|
1046
|
-
_hash32, _hash52, _hash64, _hash128, _hash256, _hash512, _hash1024,
|
|
1047
|
-
referenceSeed = 'chongo <Landon Curt Noll> /\\../\\',
|
|
1048
|
-
defaultKeyspace = 52,
|
|
1049
|
-
fnvConstants = {
|
|
1050
|
-
32: {offset: 0},
|
|
1051
|
-
64: {offset: [0,0,0,0]},
|
|
1052
|
-
128: {offset: [0,0,0,0,0,0,0,0]},
|
|
1053
|
-
256: {offset: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},
|
|
1054
|
-
512: {offset: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},
|
|
1055
|
-
1024: {offset: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}};
|
|
1056
|
-
|
|
1057
|
-
for(i=0; i < 256; i++){
|
|
1058
|
-
hl[i] = ((i >> 4) & 15).toString(16) + (i & 15).toString(16);
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
function hexToBase(hex, base){
|
|
1062
|
-
var alphabet = '0123456789abcdefghijklmnopqrstuvwxyz',
|
|
1063
|
-
digits = [0], carry, i, j, string = '';
|
|
1064
|
-
|
|
1065
|
-
for(i = 0; i < hex.length; i+=2){
|
|
1066
|
-
carry = parseInt(hex.substr(i,2),16);
|
|
1067
|
-
for(j = 0; j < digits.length; j++){
|
|
1068
|
-
carry += digits[j] << 8;
|
|
1069
|
-
digits[j] = carry % base;
|
|
1070
|
-
carry = (carry / base) | 0;
|
|
1071
|
-
}
|
|
1072
|
-
while (carry > 0) {
|
|
1073
|
-
digits.push(carry % base);
|
|
1074
|
-
carry = (carry / base) | 0;
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
for (i = digits.length - 1; i >= 0; --i){
|
|
1079
|
-
string += alphabet[digits[i]];
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
return string;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
function hashValHex(value, keyspace) {
|
|
1086
|
-
return {
|
|
1087
|
-
bits: keyspace,
|
|
1088
|
-
value: value,
|
|
1089
|
-
dec: function(){return hexToBase(value, 10);},
|
|
1090
|
-
hex: function(){return value;},
|
|
1091
|
-
str: function(){return hexToBase(value, 36);}
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
function hashValInt32(value, keyspace) {
|
|
1096
|
-
return {
|
|
1097
|
-
bits: keyspace,
|
|
1098
|
-
value: value,
|
|
1099
|
-
dec: function(){return value.toString();},
|
|
1100
|
-
hex: function(){return hl[value>>>24]+ hl[(value>>>16)&255]+hl[(value>>>8)&255]+hl[value&255];},
|
|
1101
|
-
str: function(){return value.toString(36);}
|
|
1102
|
-
};
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
function hashValInt52(value, keyspace) {
|
|
1106
|
-
return {
|
|
1107
|
-
bits: keyspace,
|
|
1108
|
-
value: value,
|
|
1109
|
-
dec: function(){return value.toString();},
|
|
1110
|
-
hex: function(){return ('0000000000000000'+value.toString(16)).substr(-13);},
|
|
1111
|
-
str: function(){return value.toString(36);}
|
|
1112
|
-
};
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
function hash(message, keyspace) {
|
|
1116
|
-
var str = (typeof message === 'object') ? JSON.stringify(message) : message;
|
|
1117
|
-
|
|
1118
|
-
switch(keyspace || defaultKeyspace){
|
|
1119
|
-
case 32:
|
|
1120
|
-
return _hash32(str);
|
|
1121
|
-
case 64:
|
|
1122
|
-
return _hash64(str);
|
|
1123
|
-
case 128:
|
|
1124
|
-
return _hash128(str);
|
|
1125
|
-
case 256:
|
|
1126
|
-
return _hash256(str);
|
|
1127
|
-
case 512:
|
|
1128
|
-
return _hash512(str);
|
|
1129
|
-
case 1024:
|
|
1130
|
-
return _hash1024(str);
|
|
1131
|
-
default:
|
|
1132
|
-
return _hash52(str);
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
function setKeyspace(keyspace) {
|
|
1137
|
-
if (keyspace === 52 || fnvConstants[keyspace]) {
|
|
1138
|
-
defaultKeyspace = keyspace;
|
|
1139
|
-
} else {
|
|
1140
|
-
throw new Error('Supported FNV keyspacs: 32, 52, 64, 128, 256, 512, and 1024 bit');
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
function setVersion(_version) {
|
|
1145
|
-
if (_version === '1a' ) {
|
|
1146
|
-
version = _version;
|
|
1147
|
-
_hash32 = useUTF8 ? _hash32_1a_utf : _hash32_1a;
|
|
1148
|
-
_hash52 = useUTF8 ? _hash52_1a_utf : _hash52_1a;
|
|
1149
|
-
_hash64 = useUTF8 ? _hash64_1a_utf : _hash64_1a;
|
|
1150
|
-
_hash128 = useUTF8 ? _hash128_1a_utf : _hash128_1a;
|
|
1151
|
-
_hash256 = useUTF8 ? _hash256_1a_utf : _hash256_1a;
|
|
1152
|
-
_hash512 = useUTF8 ? _hash512_1a_utf : _hash512_1a;
|
|
1153
|
-
_hash1024 = useUTF8 ? _hash1024_1a_utf : _hash1024_1a;
|
|
1154
|
-
} else if (_version === '1') {
|
|
1155
|
-
version = _version;
|
|
1156
|
-
_hash32 = useUTF8 ? _hash32_1_utf : _hash32_1;
|
|
1157
|
-
_hash52 = useUTF8 ? _hash52_1_utf : _hash52_1;
|
|
1158
|
-
_hash64 = useUTF8 ? _hash64_1_utf : _hash64_1;
|
|
1159
|
-
_hash128 = useUTF8 ? _hash128_1_utf : _hash128_1;
|
|
1160
|
-
_hash256 = useUTF8 ? _hash256_1_utf : _hash256_1;
|
|
1161
|
-
_hash512 = useUTF8 ? _hash512_1_utf : _hash512_1;
|
|
1162
|
-
_hash1024 = useUTF8 ? _hash1024_1_utf : _hash1024_1;
|
|
1163
|
-
} else {
|
|
1164
|
-
throw new Error('Supported FNV versions: 1, 1a');
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
function setUTF8(utf8) {
|
|
1169
|
-
if (utf8) {
|
|
1170
|
-
useUTF8 = true;
|
|
1171
|
-
_hash32 = version == '1a' ? _hash32_1a_utf : _hash32_1_utf;
|
|
1172
|
-
_hash52 = version == '1a' ? _hash52_1a_utf : _hash52_1_utf;
|
|
1173
|
-
_hash64 = version == '1a' ? _hash64_1a_utf : _hash64_1_utf;
|
|
1174
|
-
_hash128 = version == '1a' ? _hash128_1a_utf : _hash128_1_utf;
|
|
1175
|
-
_hash256 = version == '1a' ? _hash256_1a_utf : _hash256_1_utf;
|
|
1176
|
-
_hash512 = version == '1a' ? _hash512_1a_utf : _hash512_1_utf;
|
|
1177
|
-
_hash1024 = version == '1a' ? _hash1024_1a_utf : _hash1024_1_utf;
|
|
1178
|
-
} else {
|
|
1179
|
-
useUTF8 = false;
|
|
1180
|
-
_hash32 = version == '1a' ? _hash32_1a : _hash32_1;
|
|
1181
|
-
_hash52 = version == '1a' ? _hash52_1a : _hash52_1;
|
|
1182
|
-
_hash64 = version == '1a' ? _hash64_1a : _hash64_1;
|
|
1183
|
-
_hash128 = version == '1a' ? _hash128_1a : _hash128_1;
|
|
1184
|
-
_hash256 = version == '1a' ? _hash256_1a : _hash256_1;
|
|
1185
|
-
_hash512 = version == '1a' ? _hash512_1a : _hash512_1;
|
|
1186
|
-
_hash1024 = version == '1a' ? _hash1024_1a : _hash1024_1;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
function seed(seed) {
|
|
1191
|
-
var oldVersion = version, res, i;
|
|
1192
|
-
|
|
1193
|
-
seed = (seed || seed === 0) ? seed : referenceSeed;
|
|
1194
|
-
|
|
1195
|
-
if (seed === referenceSeed) setVersion('1');
|
|
1196
|
-
|
|
1197
|
-
for (var keysize in fnvConstants) {
|
|
1198
|
-
fnvConstants[keysize].offset = [];
|
|
1199
|
-
for(i = 0; i < keysize / 16; i++){
|
|
1200
|
-
fnvConstants[keysize].offset[i] = 0;
|
|
1201
|
-
}
|
|
1202
|
-
res = hash(seed, parseInt(keysize, 10)).hex();
|
|
1203
|
-
for(i = 0; i < keysize / 16; i++){
|
|
1204
|
-
fnvConstants[keysize].offset[i] = parseInt(res.substr(i*4,4), 16);
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
setVersion(oldVersion);
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
/**
|
|
1212
|
-
* Implementation without library overhead.
|
|
1213
|
-
*/
|
|
1214
|
-
|
|
1215
|
-
function _hash32_1a_fast(str) {
|
|
1216
|
-
var i, l = str.length-3, t0=0,v0=0x9dc5,t1=0,v1=0x811c;
|
|
1217
|
-
|
|
1218
|
-
for (i = 0; i < l;) {
|
|
1219
|
-
v0^=str.charCodeAt(i++);
|
|
1220
|
-
t0=v0*403;t1=v1*403;
|
|
1221
|
-
t1+=v0<<8;
|
|
1222
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1223
|
-
v0^=str.charCodeAt(i++);
|
|
1224
|
-
t0=v0*403;t1=v1*403;
|
|
1225
|
-
t1+=v0<<8;
|
|
1226
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1227
|
-
v0^=str.charCodeAt(i++);
|
|
1228
|
-
t0=v0*403;t1=v1*403;
|
|
1229
|
-
t1+=v0<<8;
|
|
1230
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1231
|
-
v0^=str.charCodeAt(i++);
|
|
1232
|
-
t0=v0*403;t1=v1*403;
|
|
1233
|
-
t1+=v0<<8;
|
|
1234
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
while(i<l+3){
|
|
1238
|
-
v0^=str.charCodeAt(i++);
|
|
1239
|
-
t0=v0*403;t1=v1*403;
|
|
1240
|
-
t1+=v0<<8;
|
|
1241
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
return ((v1<<16)>>>0)+v0;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
function _hash32_1a_fast_hex(str) {
|
|
1249
|
-
var i, l = str.length-3, t0=0,v0=0x9dc5,t1=0,v1=0x811c;
|
|
1250
|
-
|
|
1251
|
-
for (i = 0; i < l;) {
|
|
1252
|
-
v0^=str.charCodeAt(i++);
|
|
1253
|
-
t0=v0*403;t1=v1*403;
|
|
1254
|
-
t1+=v0<<8;
|
|
1255
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1256
|
-
v0^=str.charCodeAt(i++);
|
|
1257
|
-
t0=v0*403;t1=v1*403;
|
|
1258
|
-
t1+=v0<<8;
|
|
1259
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1260
|
-
v0^=str.charCodeAt(i++);
|
|
1261
|
-
t0=v0*403;t1=v1*403;
|
|
1262
|
-
t1+=v0<<8;
|
|
1263
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1264
|
-
v0^=str.charCodeAt(i++);
|
|
1265
|
-
t0=v0*403;t1=v1*403;
|
|
1266
|
-
t1+=v0<<8;
|
|
1267
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
while(i<l+3){
|
|
1271
|
-
v0^=str.charCodeAt(i++);
|
|
1272
|
-
t0=v0*403;t1=v1*403;
|
|
1273
|
-
t1+=v0<<8;
|
|
1274
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
return hl[(v1>>>8)&255]+hl[v1&255]+hl[(v0>>>8)&255]+hl[v0&255];
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
function _hash52_1a_fast(str){
|
|
1282
|
-
var i,l=str.length-3,t0=0,v0=0x2325,t1=0,v1=0x8422,t2=0,v2=0x9ce4,t3=0,v3=0xcbf2;
|
|
1283
|
-
|
|
1284
|
-
for (i = 0; i < l;) {
|
|
1285
|
-
v0^=str.charCodeAt(i++);
|
|
1286
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1287
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1288
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1289
|
-
v0^=str.charCodeAt(i++);
|
|
1290
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1291
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1292
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1293
|
-
v0^=str.charCodeAt(i++);
|
|
1294
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1295
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1296
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1297
|
-
v0^=str.charCodeAt(i++);
|
|
1298
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1299
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1300
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
while(i<l+3){
|
|
1304
|
-
v0^=str.charCodeAt(i++);
|
|
1305
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1306
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1307
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
return (v3&15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0^(v3>>4));
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
function _hash52_1a_fast_hex(str){
|
|
1314
|
-
var i,l=str.length-3,t0=0,v0=0x2325,t1=0,v1=0x8422,t2=0,v2=0x9ce4,t3=0,v3=0xcbf2;
|
|
1315
|
-
|
|
1316
|
-
for (i = 0; i < l;) {
|
|
1317
|
-
v0^=str.charCodeAt(i++);
|
|
1318
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1319
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1320
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1321
|
-
v0^=str.charCodeAt(i++);
|
|
1322
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1323
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1324
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1325
|
-
v0^=str.charCodeAt(i++);
|
|
1326
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1327
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1328
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1329
|
-
v0^=str.charCodeAt(i++);
|
|
1330
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1331
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1332
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
while(i<l+3){
|
|
1336
|
-
v0^=str.charCodeAt(i++);
|
|
1337
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1338
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1339
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
return hl16[v3&15]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[(v0>>8)^(v3>>12)]+hl[(v0^(v3>>4))&255];
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
function _hash64_1a_fast(str){
|
|
1346
|
-
var i,l=str.length-3,t0=0,v0=0x2325,t1=0,v1=0x8422,t2=0,v2=0x9ce4,t3=0,v3=0xcbf2;
|
|
1347
|
-
|
|
1348
|
-
for (i = 0; i < l;) {
|
|
1349
|
-
v0^=str.charCodeAt(i++);
|
|
1350
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1351
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1352
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1353
|
-
v0^=str.charCodeAt(i++);
|
|
1354
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1355
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1356
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1357
|
-
v0^=str.charCodeAt(i++);
|
|
1358
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1359
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1360
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1361
|
-
v0^=str.charCodeAt(i++);
|
|
1362
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1363
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1364
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
while(i<l+3){
|
|
1368
|
-
v0^=str.charCodeAt(i++);
|
|
1369
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1370
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1371
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
return hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255];
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
function _hash32_1a_fast_utf(str) {
|
|
1378
|
-
var c,i,l=str.length,t0=0,v0=0x9dc5,t1=0,v1=0x811c;
|
|
1379
|
-
|
|
1380
|
-
for (i = 0; i < l; i++) {
|
|
1381
|
-
c = str.charCodeAt(i);
|
|
1382
|
-
if(c < 128){
|
|
1383
|
-
v0^=c;
|
|
1384
|
-
}else if(c < 2048){
|
|
1385
|
-
v0^=(c>>6)|192;
|
|
1386
|
-
t0=v0*403;t1=v1*403;
|
|
1387
|
-
t1+=v0<<8;
|
|
1388
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1389
|
-
v0^=(c&63)|128;
|
|
1390
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1391
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1392
|
-
v0^=(c>>18)|240;
|
|
1393
|
-
t0=v0*403;t1=v1*403;
|
|
1394
|
-
t1+=v0<<8;
|
|
1395
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1396
|
-
v0^=((c>>12)&63)|128;
|
|
1397
|
-
t0=v0*403;t1=v1*403;
|
|
1398
|
-
t1+=v0<<8;
|
|
1399
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1400
|
-
v0^=((c>>6)&63)|128;
|
|
1401
|
-
t0=v0*403;t1=v1*403;
|
|
1402
|
-
t1+=v0<<8;
|
|
1403
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1404
|
-
v0^=(c&63)|128;
|
|
1405
|
-
}else{
|
|
1406
|
-
v0^=(c>>12)|224;
|
|
1407
|
-
t0=v0*403;t1=v1*403;
|
|
1408
|
-
t1+=v0<<8;
|
|
1409
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1410
|
-
v0^=((c>>6)&63)|128;
|
|
1411
|
-
t0=v0*403;t1=v1*403;
|
|
1412
|
-
t1+=v0<<8;
|
|
1413
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1414
|
-
v0^=(c&63)|128;
|
|
1415
|
-
}
|
|
1416
|
-
t0=v0*403;t1=v1*403;
|
|
1417
|
-
t1+=v0<<8;
|
|
1418
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
return ((v1<<16)>>>0)+v0;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
function _hash32_1a_fast_hex_utf(str) {
|
|
1425
|
-
var c,i,l=str.length,t0=0,v0=0x9dc5,t1=0,v1=0x811c;
|
|
1426
|
-
|
|
1427
|
-
for (i = 0; i < l; i++) {
|
|
1428
|
-
c = str.charCodeAt(i);
|
|
1429
|
-
if(c < 128){
|
|
1430
|
-
v0^=c;
|
|
1431
|
-
}else if(c < 2048){
|
|
1432
|
-
v0^=(c>>6)|192;
|
|
1433
|
-
t0=v0*403;t1=v1*403;
|
|
1434
|
-
t1+=v0<<8;
|
|
1435
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1436
|
-
v0^=(c&63)|128;
|
|
1437
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1438
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1439
|
-
v0^=(c>>18)|240;
|
|
1440
|
-
t0=v0*403;t1=v1*403;
|
|
1441
|
-
t1+=v0<<8;
|
|
1442
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1443
|
-
v0^=((c>>12)&63)|128;
|
|
1444
|
-
t0=v0*403;t1=v1*403;
|
|
1445
|
-
t1+=v0<<8;
|
|
1446
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1447
|
-
v0^=((c>>6)&63)|128;
|
|
1448
|
-
t0=v0*403;t1=v1*403;
|
|
1449
|
-
t1+=v0<<8;
|
|
1450
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1451
|
-
v0^=(c&63)|128;
|
|
1452
|
-
}else{
|
|
1453
|
-
v0^=(c>>12)|224;
|
|
1454
|
-
t0=v0*403;t1=v1*403;
|
|
1455
|
-
t1+=v0<<8;
|
|
1456
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1457
|
-
v0^=((c>>6)&63)|128;
|
|
1458
|
-
t0=v0*403;t1=v1*403;
|
|
1459
|
-
t1+=v0<<8;
|
|
1460
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1461
|
-
v0^=(c&63)|128;
|
|
1462
|
-
}
|
|
1463
|
-
t0=v0*403;t1=v1*403;
|
|
1464
|
-
t1+=v0<<8;
|
|
1465
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
return hl[(v1>>>8)&255]+hl[v1&255]+hl[(v0>>>8)&255]+hl[v0&255];
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
function _hash52_1a_fast_utf(str){
|
|
1473
|
-
var c,i,l=str.length,t0=0,v0=0x2325,t1=0,v1=0x8422,t2=0,v2=0x9ce4,t3=0,v3=0xcbf2;
|
|
1474
|
-
|
|
1475
|
-
for (i = 0; i < l; i++) {
|
|
1476
|
-
c = str.charCodeAt(i);
|
|
1477
|
-
if(c < 128){
|
|
1478
|
-
v0^=c;
|
|
1479
|
-
}else if(c < 2048){
|
|
1480
|
-
v0^=(c>>6)|192;
|
|
1481
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1482
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1483
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1484
|
-
v0^=(c&63)|128;
|
|
1485
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1486
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1487
|
-
v0^=(c>>18)|240;
|
|
1488
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1489
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1490
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1491
|
-
v0^=((c>>12)&63)|128;
|
|
1492
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1493
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1494
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1495
|
-
v0^=((c>>6)&63)|128;
|
|
1496
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1497
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1498
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1499
|
-
v0^=(c&63)|128;
|
|
1500
|
-
}else{
|
|
1501
|
-
v0^=(c>>12)|224;
|
|
1502
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1503
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1504
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1505
|
-
v0^=((c>>6)&63)|128;
|
|
1506
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1507
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1508
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1509
|
-
v0^=(c&63)|128;
|
|
1510
|
-
}
|
|
1511
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1512
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1513
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
return (v3&15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0^(v3>>4));
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
function _hash52_1a_fast_hex_utf (str){
|
|
1520
|
-
var c,i,l=str.length,t0=0,v0=0x2325,t1=0,v1=0x8422,t2=0,v2=0x9ce4,t3=0,v3=0xcbf2;
|
|
1521
|
-
|
|
1522
|
-
for (i = 0; i < l; i++) {
|
|
1523
|
-
c = str.charCodeAt(i);
|
|
1524
|
-
if(c < 128){
|
|
1525
|
-
v0^=c;
|
|
1526
|
-
}else if(c < 2048){
|
|
1527
|
-
v0^=(c>>6)|192;
|
|
1528
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1529
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1530
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1531
|
-
v0^=(c&63)|128;
|
|
1532
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1533
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1534
|
-
v0^=(c>>18)|240;
|
|
1535
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1536
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1537
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1538
|
-
v0^=((c>>12)&63)|128;
|
|
1539
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1540
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1541
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1542
|
-
v0^=((c>>6)&63)|128;
|
|
1543
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1544
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1545
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1546
|
-
v0^=(c&63)|128;
|
|
1547
|
-
}else{
|
|
1548
|
-
v0^=(c>>12)|224;
|
|
1549
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1550
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1551
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1552
|
-
v0^=((c>>6)&63)|128;
|
|
1553
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1554
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1555
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1556
|
-
v0^=(c&63)|128;
|
|
1557
|
-
}
|
|
1558
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1559
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1560
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
return hl16[v3&15]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[(v0>>8)^(v3>>12)]+hl[(v0^(v3>>4))&255];
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
function _hash64_1a_fast_utf(str){
|
|
1567
|
-
var c,i,l=str.length,t0=0,v0=0x2325,t1=0,v1=0x8422,t2=0,v2=0x9ce4,t3=0,v3=0xcbf2;
|
|
1568
|
-
|
|
1569
|
-
for (i = 0; i < l; i++) {
|
|
1570
|
-
c = str.charCodeAt(i);
|
|
1571
|
-
if(c < 128){
|
|
1572
|
-
v0^=c;
|
|
1573
|
-
}else if(c < 2048){
|
|
1574
|
-
v0^=(c>>6)|192;
|
|
1575
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1576
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1577
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1578
|
-
v0^=(c&63)|128;
|
|
1579
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1580
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1581
|
-
v0^=(c>>18)|240;
|
|
1582
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1583
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1584
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1585
|
-
v0^=((c>>12)&63)|128;
|
|
1586
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1587
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1588
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1589
|
-
v0^=((c>>6)&63)|128;
|
|
1590
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1591
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1592
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1593
|
-
v0^=(c&63)|128;
|
|
1594
|
-
}else{
|
|
1595
|
-
v0^=(c>>12)|224;
|
|
1596
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1597
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1598
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1599
|
-
v0^=((c>>6)&63)|128;
|
|
1600
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1601
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1602
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1603
|
-
v0^=(c&63)|128;
|
|
1604
|
-
}
|
|
1605
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1606
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1607
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1608
|
-
}
|
|
1609
|
-
|
|
1610
|
-
return hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255];
|
|
1611
|
-
}
|
|
1612
|
-
/**
|
|
1613
|
-
* Regular functions. This versions are accessible through API
|
|
1614
|
-
*/
|
|
1615
|
-
|
|
1616
|
-
function _hash32_1a(str){
|
|
1617
|
-
var i,l=str.length-3,s=fnvConstants[32].offset,t0=0,v0=s[1]|0,t1=0,v1=s[0]|0;
|
|
1618
|
-
|
|
1619
|
-
for (i = 0; i < l;) {
|
|
1620
|
-
v0^=str.charCodeAt(i++);
|
|
1621
|
-
t0=v0*403;t1=v1*403;
|
|
1622
|
-
t1+=v0<<8;
|
|
1623
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1624
|
-
v0^=str.charCodeAt(i++);
|
|
1625
|
-
t0=v0*403;t1=v1*403;
|
|
1626
|
-
t1+=v0<<8;
|
|
1627
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1628
|
-
v0^=str.charCodeAt(i++);
|
|
1629
|
-
t0=v0*403;t1=v1*403;
|
|
1630
|
-
t1+=v0<<8;
|
|
1631
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1632
|
-
v0^=str.charCodeAt(i++);
|
|
1633
|
-
t0=v0*403;t1=v1*403;
|
|
1634
|
-
t1+=v0<<8;
|
|
1635
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
while(i<l+3){
|
|
1639
|
-
v0^=str.charCodeAt(i++);
|
|
1640
|
-
t0=v0*403;t1=v1*403;
|
|
1641
|
-
t1+=v0<<8;
|
|
1642
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
return hashValInt32(((v1<<16)>>>0)+v0,32);
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
function _hash32_1(str){
|
|
1649
|
-
var i,l=str.length-3,s=fnvConstants[32].offset,t0=0,v0=s[1]|0,t1=0,v1=s[0]|0;
|
|
1650
|
-
|
|
1651
|
-
for (i = 0; i < l;) {
|
|
1652
|
-
t0=v0*403;t1=v1*403;
|
|
1653
|
-
t1+=v0<<8;
|
|
1654
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1655
|
-
v0^=str.charCodeAt(i++);
|
|
1656
|
-
t0=v0*403;t1=v1*403;
|
|
1657
|
-
t1+=v0<<8;
|
|
1658
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1659
|
-
v0^=str.charCodeAt(i++);
|
|
1660
|
-
t0=v0*403;t1=v1*403;
|
|
1661
|
-
t1+=v0<<8;
|
|
1662
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1663
|
-
v0^=str.charCodeAt(i++);
|
|
1664
|
-
t0=v0*403;t1=v1*403;
|
|
1665
|
-
t1+=v0<<8;
|
|
1666
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1667
|
-
v0^=str.charCodeAt(i++);
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
while(i<l+3){
|
|
1671
|
-
t0=v0*403;t1=v1*403;
|
|
1672
|
-
t1+=v0<<8;
|
|
1673
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1674
|
-
v0^=str.charCodeAt(i++);
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
return hashValInt32(((v1<<16)>>>0)+v0,32);
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
function _hash32_1a_utf(str){
|
|
1681
|
-
var c,i,l=str.length,s=fnvConstants[32].offset,t0=0,v0=s[1]|0,t1=0,v1=s[0]|0;
|
|
1682
|
-
|
|
1683
|
-
for (i = 0; i < l; i++) {
|
|
1684
|
-
c = str.charCodeAt(i);
|
|
1685
|
-
if(c < 128){
|
|
1686
|
-
v0^=c;
|
|
1687
|
-
}else if(c < 2048){
|
|
1688
|
-
v0^=(c>>6)|192;
|
|
1689
|
-
t0=v0*403;t1=v1*403;
|
|
1690
|
-
t1+=v0<<8;
|
|
1691
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1692
|
-
v0^=(c&63)|128;
|
|
1693
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1694
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1695
|
-
v0^=(c>>18)|240;
|
|
1696
|
-
t0=v0*403;t1=v1*403;
|
|
1697
|
-
t1+=v0<<8;
|
|
1698
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1699
|
-
v0^=((c>>12)&63)|128;
|
|
1700
|
-
t0=v0*403;t1=v1*403;
|
|
1701
|
-
t1+=v0<<8;
|
|
1702
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1703
|
-
v0^=((c>>6)&63)|128;
|
|
1704
|
-
t0=v0*403;t1=v1*403;
|
|
1705
|
-
t1+=v0<<8;
|
|
1706
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1707
|
-
v0^=(c&63)|128;
|
|
1708
|
-
}else{
|
|
1709
|
-
v0^=(c>>12)|224;
|
|
1710
|
-
t0=v0*403;t1=v1*403;
|
|
1711
|
-
t1+=v0<<8;
|
|
1712
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1713
|
-
v0^=((c>>6)&63)|128;
|
|
1714
|
-
t0=v0*403;t1=v1*403;
|
|
1715
|
-
t1+=v0<<8;
|
|
1716
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1717
|
-
v0^=(c&63)|128;
|
|
1718
|
-
}
|
|
1719
|
-
t0=v0*403;t1=v1*403;
|
|
1720
|
-
t1+=v0<<8;
|
|
1721
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
return hashValInt32(((v1<<16)>>>0)+v0,32);
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
function _hash32_1_utf(str){
|
|
1728
|
-
var c,i,l=str.length,s=fnvConstants[32].offset,t0=0,v0=s[1]|0,t1=0,v1=s[0]|0;
|
|
1729
|
-
|
|
1730
|
-
for (i = 0; i < l; i++) {
|
|
1731
|
-
c = str.charCodeAt(i);
|
|
1732
|
-
t0=v0*403;t1=v1*403;
|
|
1733
|
-
t1+=v0<<8;
|
|
1734
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1735
|
-
if(c < 128){
|
|
1736
|
-
v0^=c;
|
|
1737
|
-
}else if(c < 2048){
|
|
1738
|
-
v0^=(c>>6)|192;
|
|
1739
|
-
t0=v0*403;t1=v1*403;
|
|
1740
|
-
t1+=v0<<8;
|
|
1741
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1742
|
-
v0^=(c&63)|128;
|
|
1743
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1744
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1745
|
-
v0^=(c>>18)|240;
|
|
1746
|
-
t0=v0*403;t1=v1*403;
|
|
1747
|
-
t1+=v0<<8;
|
|
1748
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1749
|
-
v0^=((c>>12)&63)|128;
|
|
1750
|
-
t0=v0*403;t1=v1*403;
|
|
1751
|
-
t1+=v0<<8;
|
|
1752
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1753
|
-
v0^=((c>>6)&63)|128;
|
|
1754
|
-
t0=v0*403;t1=v1*403;
|
|
1755
|
-
t1+=v0<<8;
|
|
1756
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1757
|
-
v0^=(c&63)|128;
|
|
1758
|
-
}else{
|
|
1759
|
-
v0^=(c>>12)|224;
|
|
1760
|
-
t0=v0*403;t1=v1*403;
|
|
1761
|
-
t1+=v0<<8;
|
|
1762
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1763
|
-
v0^=((c>>6)&63)|128;
|
|
1764
|
-
t0=v0*403;t1=v1*403;
|
|
1765
|
-
t1+=v0<<8;
|
|
1766
|
-
v1=(t1+(t0>>>16))&65535;v0=t0&65535;
|
|
1767
|
-
v0^=(c&63)|128;
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
return hashValInt32(((v1<<16)>>>0)+v0,32);
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
_hash32 = _hash32_1a;
|
|
1775
|
-
|
|
1776
|
-
function _hash52_1a(str){
|
|
1777
|
-
var i,l=str.length-3,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
1778
|
-
|
|
1779
|
-
for (i = 0; i < l;) {
|
|
1780
|
-
v0^=str.charCodeAt(i++);
|
|
1781
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1782
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1783
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1784
|
-
v0^=str.charCodeAt(i++);
|
|
1785
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1786
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1787
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1788
|
-
v0^=str.charCodeAt(i++);
|
|
1789
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1790
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1791
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1792
|
-
v0^=str.charCodeAt(i++);
|
|
1793
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1794
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1795
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
while(i<l+3){
|
|
1799
|
-
v0^=str.charCodeAt(i++);
|
|
1800
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1801
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1802
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
return hashValInt52((v3&15)*281474976710656+v2*4294967296+v1*65536+(v0^(v3>>4)),52);
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
function _hash52_1(str){
|
|
1809
|
-
var i,l=str.length-3,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
1810
|
-
|
|
1811
|
-
for (i = 0; i < l;) {
|
|
1812
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1813
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1814
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1815
|
-
v0^=str.charCodeAt(i++);
|
|
1816
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1817
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1818
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1819
|
-
v0^=str.charCodeAt(i++);
|
|
1820
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1821
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1822
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1823
|
-
v0^=str.charCodeAt(i++);
|
|
1824
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1825
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1826
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1827
|
-
v0^=str.charCodeAt(i++);
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
|
-
while(i<l+3){
|
|
1831
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1832
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1833
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1834
|
-
v0^=str.charCodeAt(i++);
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
return hashValInt52((v3&15)*281474976710656+v2*4294967296+v1*65536+(v0^(v3>>4)),52);
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
function _hash52_1a_utf(str){
|
|
1841
|
-
var c,i,l=str.length,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
1842
|
-
|
|
1843
|
-
for (i = 0; i < l; i++) {
|
|
1844
|
-
c = str.charCodeAt(i);
|
|
1845
|
-
if(c < 128){
|
|
1846
|
-
v0^=c;
|
|
1847
|
-
}else if(c < 2048){
|
|
1848
|
-
v0^=(c>>6)|192;
|
|
1849
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1850
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1851
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1852
|
-
v0^=(c&63)|128;
|
|
1853
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1854
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1855
|
-
v0^=(c>>18)|240;
|
|
1856
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1857
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1858
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1859
|
-
v0^=((c>>12)&63)|128;
|
|
1860
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1861
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1862
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1863
|
-
v0^=((c>>6)&63)|128;
|
|
1864
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1865
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1866
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1867
|
-
v0^=(c&63)|128;
|
|
1868
|
-
}else{
|
|
1869
|
-
v0^=(c>>12)|224;
|
|
1870
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1871
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1872
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1873
|
-
v0^=((c>>6)&63)|128;
|
|
1874
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1875
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1876
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1877
|
-
v0^=(c&63)|128;
|
|
1878
|
-
}
|
|
1879
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1880
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1881
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1882
|
-
}
|
|
1883
|
-
|
|
1884
|
-
return hashValInt52((v3&15)*281474976710656+v2*4294967296+v1*65536+(v0^(v3>>4)),52);
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
function _hash52_1_utf(str){
|
|
1888
|
-
var c,i,l=str.length,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
1889
|
-
|
|
1890
|
-
for (i = 0; i < l; i++) {
|
|
1891
|
-
c = str.charCodeAt(i);
|
|
1892
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1893
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1894
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1895
|
-
if(c < 128){
|
|
1896
|
-
v0^=c;
|
|
1897
|
-
}else if(c < 2048){
|
|
1898
|
-
v0^=(c>>6)|192;
|
|
1899
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1900
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1901
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1902
|
-
v0^=(c&63)|128;
|
|
1903
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
1904
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
1905
|
-
v0^=(c>>18)|240;
|
|
1906
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1907
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1908
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1909
|
-
v0^=((c>>12)&63)|128;
|
|
1910
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1911
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1912
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1913
|
-
v0^=((c>>6)&63)|128;
|
|
1914
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1915
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1916
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1917
|
-
v0^=(c&63)|128;
|
|
1918
|
-
}else{
|
|
1919
|
-
v0^=(c>>12)|224;
|
|
1920
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1921
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1922
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1923
|
-
v0^=((c>>6)&63)|128;
|
|
1924
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1925
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1926
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1927
|
-
v0^=(c&63)|128;
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
return hashValInt52((v3&15)*281474976710656+v2*4294967296+v1*65536+(v0^(v3>>4)),52);
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
_hash52 = _hash52_1a;
|
|
1935
|
-
|
|
1936
|
-
function _hash64_1a(str){
|
|
1937
|
-
var i,l=str.length-3,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
1938
|
-
|
|
1939
|
-
for (i = 0; i < l;) {
|
|
1940
|
-
v0^=str.charCodeAt(i++);
|
|
1941
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1942
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1943
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1944
|
-
v0^=str.charCodeAt(i++);
|
|
1945
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1946
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1947
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1948
|
-
v0^=str.charCodeAt(i++);
|
|
1949
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1950
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1951
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1952
|
-
v0^=str.charCodeAt(i++);
|
|
1953
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1954
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1955
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
while(i<l+3){
|
|
1959
|
-
v0^=str.charCodeAt(i++);
|
|
1960
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1961
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1962
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
return hashValHex(hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],64);
|
|
1966
|
-
}
|
|
1967
|
-
|
|
1968
|
-
function _hash64_1(str){
|
|
1969
|
-
var i,l=str.length-3,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
1970
|
-
|
|
1971
|
-
for (i = 0; i < l;) {
|
|
1972
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1973
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1974
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1975
|
-
v0^=str.charCodeAt(i++);
|
|
1976
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1977
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1978
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1979
|
-
v0^=str.charCodeAt(i++);
|
|
1980
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1981
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1982
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1983
|
-
v0^=str.charCodeAt(i++);
|
|
1984
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1985
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1986
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1987
|
-
v0^=str.charCodeAt(i++);
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
while(i<l+3){
|
|
1991
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
1992
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
1993
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
1994
|
-
v0^=str.charCodeAt(i++);
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
return hashValHex(hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],64);
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
function _hash64_1a_utf(str){
|
|
2001
|
-
var c,i,l=str.length,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
2002
|
-
|
|
2003
|
-
for (i = 0; i < l; i++) {
|
|
2004
|
-
c = str.charCodeAt(i);
|
|
2005
|
-
if(c < 128){
|
|
2006
|
-
v0^=c;
|
|
2007
|
-
}else if(c < 2048){
|
|
2008
|
-
v0^=(c>>6)|192;
|
|
2009
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2010
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2011
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2012
|
-
v0^=(c&63)|128;
|
|
2013
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2014
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2015
|
-
v0^=(c>>18)|240;
|
|
2016
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2017
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2018
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2019
|
-
v0^=((c>>12)&63)|128;
|
|
2020
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2021
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2022
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2023
|
-
v0^=((c>>6)&63)|128;
|
|
2024
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2025
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2026
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2027
|
-
v0^=(c&63)|128;
|
|
2028
|
-
}else{
|
|
2029
|
-
v0^=(c>>12)|224;
|
|
2030
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2031
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2032
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2033
|
-
v0^=((c>>6)&63)|128;
|
|
2034
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2035
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2036
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2037
|
-
v0^=(c&63)|128;
|
|
2038
|
-
}
|
|
2039
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2040
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2041
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2044
|
-
return hashValHex(hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],64);
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
function _hash64_1_utf(str){
|
|
2048
|
-
var c,i,l=str.length,s=fnvConstants[64].offset,t0=0,v0=s[3]|0,t1=0,v1=s[2]|0,t2=0,v2=s[1]|0,t3=0,v3=s[0]|0;
|
|
2049
|
-
|
|
2050
|
-
for (i = 0; i < l; i++) {
|
|
2051
|
-
c = str.charCodeAt(i);
|
|
2052
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2053
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2054
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2055
|
-
if(c < 128){
|
|
2056
|
-
v0^=c;
|
|
2057
|
-
}else if(c < 2048){
|
|
2058
|
-
v0^=(c>>6)|192;
|
|
2059
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2060
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2061
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2062
|
-
v0^=(c&63)|128;
|
|
2063
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2064
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2065
|
-
v0^=(c>>18)|240;
|
|
2066
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2067
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2068
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2069
|
-
v0^=((c>>12)&63)|128;
|
|
2070
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2071
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2072
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2073
|
-
v0^=((c>>6)&63)|128;
|
|
2074
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2075
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2076
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2077
|
-
v0^=(c&63)|128;
|
|
2078
|
-
}else{
|
|
2079
|
-
v0^=(c>>12)|224;
|
|
2080
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2081
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2082
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2083
|
-
v0^=((c>>6)&63)|128;
|
|
2084
|
-
t0=v0*435;t1=v1*435;t2=v2*435;t3=v3*435;
|
|
2085
|
-
t2+=v0<<8;t3+=v1<<8;
|
|
2086
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;v3=(t3+(t2>>>16))&65535;v2=t2&65535;
|
|
2087
|
-
v0^=(c&63)|128;
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
|
|
2091
|
-
return hashValHex(hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],64);
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
_hash64 = _hash64_1a;
|
|
2095
|
-
|
|
2096
|
-
function _hash128_1a(str){
|
|
2097
|
-
var i,l=str.length-3,s=fnvConstants[128].offset,t0=0,v0=s[7]|0,t1=0,v1=s[6]|0,t2=0,v2=s[5]|0,t3=0,v3=s[4]|0,t4=0,v4=s[3]|0,t5=0,v5=s[2]|0,t6=0,v6=s[1]|0,t7=0,v7=s[0]|0;
|
|
2098
|
-
|
|
2099
|
-
for (i = 0; i < l;) {
|
|
2100
|
-
v0^=str.charCodeAt(i++);
|
|
2101
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2102
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2103
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2104
|
-
v0^=str.charCodeAt(i++);
|
|
2105
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2106
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2107
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2108
|
-
v0^=str.charCodeAt(i++);
|
|
2109
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2110
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2111
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2112
|
-
v0^=str.charCodeAt(i++);
|
|
2113
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2114
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2115
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
while(i<l+3){
|
|
2119
|
-
v0^=str.charCodeAt(i++);
|
|
2120
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2121
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2122
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
return hashValHex(hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],128);
|
|
2126
|
-
}
|
|
2127
|
-
|
|
2128
|
-
function _hash128_1(str){
|
|
2129
|
-
var i,l=str.length-3,s=fnvConstants[128].offset,t0=0,v0=s[7]|0,t1=0,v1=s[6]|0,t2=0,v2=s[5]|0,t3=0,v3=s[4]|0,t4=0,v4=s[3]|0,t5=0,v5=s[2]|0,t6=0,v6=s[1]|0,t7=0,v7=s[0]|0;
|
|
2130
|
-
|
|
2131
|
-
for (i = 0; i < l;) {
|
|
2132
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2133
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2134
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2135
|
-
v0^=str.charCodeAt(i++);
|
|
2136
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2137
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2138
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2139
|
-
v0^=str.charCodeAt(i++);
|
|
2140
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2141
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2142
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2143
|
-
v0^=str.charCodeAt(i++);
|
|
2144
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2145
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2146
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2147
|
-
v0^=str.charCodeAt(i++);
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
|
-
while(i<l+3){
|
|
2151
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2152
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2153
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2154
|
-
v0^=str.charCodeAt(i++);
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
return hashValHex(hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],128);
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
function _hash128_1a_utf(str){
|
|
2161
|
-
var c,i,l=str.length,s=fnvConstants[128].offset,t0=0,v0=s[7]|0,t1=0,v1=s[6]|0,t2=0,v2=s[5]|0,t3=0,v3=s[4]|0,t4=0,v4=s[3]|0,t5=0,v5=s[2]|0,t6=0,v6=s[1]|0,t7=0,v7=s[0]|0;
|
|
2162
|
-
|
|
2163
|
-
for (i = 0; i < l; i++) {
|
|
2164
|
-
c = str.charCodeAt(i);
|
|
2165
|
-
if(c < 128){
|
|
2166
|
-
v0^=c;
|
|
2167
|
-
}else if(c < 2048){
|
|
2168
|
-
v0^=(c>>6)|192;
|
|
2169
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2170
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2171
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2172
|
-
v0^=(c&63)|128;
|
|
2173
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2174
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2175
|
-
v0^=(c>>18)|240;
|
|
2176
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2177
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2178
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2179
|
-
v0^=((c>>12)&63)|128;
|
|
2180
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2181
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2182
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2183
|
-
v0^=((c>>6)&63)|128;
|
|
2184
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2185
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2186
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2187
|
-
v0^=(c&63)|128;
|
|
2188
|
-
}else{
|
|
2189
|
-
v0^=(c>>12)|224;
|
|
2190
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2191
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2192
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2193
|
-
v0^=((c>>6)&63)|128;
|
|
2194
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2195
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2196
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2197
|
-
v0^=(c&63)|128;
|
|
2198
|
-
}
|
|
2199
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2200
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2201
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
|
-
return hashValHex(hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],128);
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
function _hash128_1_utf(str){
|
|
2208
|
-
var c,i,l=str.length,s=fnvConstants[128].offset,t0=0,v0=s[7]|0,t1=0,v1=s[6]|0,t2=0,v2=s[5]|0,t3=0,v3=s[4]|0,t4=0,v4=s[3]|0,t5=0,v5=s[2]|0,t6=0,v6=s[1]|0,t7=0,v7=s[0]|0;
|
|
2209
|
-
|
|
2210
|
-
for (i = 0; i < l; i++) {
|
|
2211
|
-
c = str.charCodeAt(i);
|
|
2212
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2213
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2214
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2215
|
-
if(c < 128){
|
|
2216
|
-
v0^=c;
|
|
2217
|
-
}else if(c < 2048){
|
|
2218
|
-
v0^=(c>>6)|192;
|
|
2219
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2220
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2221
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2222
|
-
v0^=(c&63)|128;
|
|
2223
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2224
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2225
|
-
v0^=(c>>18)|240;
|
|
2226
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2227
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2228
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2229
|
-
v0^=((c>>12)&63)|128;
|
|
2230
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2231
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2232
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2233
|
-
v0^=((c>>6)&63)|128;
|
|
2234
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2235
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2236
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2237
|
-
v0^=(c&63)|128;
|
|
2238
|
-
}else{
|
|
2239
|
-
v0^=(c>>12)|224;
|
|
2240
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2241
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2242
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2243
|
-
v0^=((c>>6)&63)|128;
|
|
2244
|
-
t0=v0*315;t1=v1*315;t2=v2*315;t3=v3*315;t4=v4*315;t5=v5*315;t6=v6*315;t7=v7*315;
|
|
2245
|
-
t5+=v0<<8;t6+=v1<<8;t7+=v2<<8;
|
|
2246
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;v7=(t7+(t6>>>16))&65535;v6=t6&65535;
|
|
2247
|
-
v0^=(c&63)|128;
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
|
|
2251
|
-
return hashValHex(hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],128);
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2254
|
-
_hash128 = _hash128_1a;
|
|
2255
|
-
|
|
2256
|
-
function _hash256_1a(str){
|
|
2257
|
-
var i,l=str.length-3,s=fnvConstants[256].offset,t0=0,v0=s[15]|0,t1=0,v1=s[14]|0,t2=0,v2=s[13]|0,t3=0,v3=s[12]|0,t4=0,v4=s[11]|0,t5=0,v5=s[10]|0,t6=0,v6=s[9]|0,t7=0,v7=s[8]|0,t8=0,v8=s[7]|0,t9=0,v9=s[6]|0,t10=0,v10=s[5]|0,t11=0,v11=s[4]|0,t12=0,v12=s[3]|0,t13=0,v13=s[2]|0,t14=0,v14=s[1]|0,t15=0,v15=s[0]|0;
|
|
2258
|
-
|
|
2259
|
-
for (i = 0; i < l;) {
|
|
2260
|
-
v0^=str.charCodeAt(i++);
|
|
2261
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2262
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2263
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2264
|
-
v0^=str.charCodeAt(i++);
|
|
2265
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2266
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2267
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2268
|
-
v0^=str.charCodeAt(i++);
|
|
2269
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2270
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2271
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2272
|
-
v0^=str.charCodeAt(i++);
|
|
2273
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2274
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2275
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
while(i<l+3){
|
|
2279
|
-
v0^=str.charCodeAt(i++);
|
|
2280
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2281
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2282
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2283
|
-
}
|
|
2284
|
-
|
|
2285
|
-
return hashValHex(hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],256);
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2288
|
-
function _hash256_1(str){
|
|
2289
|
-
var i,l=str.length-3,s=fnvConstants[256].offset,t0=0,v0=s[15]|0,t1=0,v1=s[14]|0,t2=0,v2=s[13]|0,t3=0,v3=s[12]|0,t4=0,v4=s[11]|0,t5=0,v5=s[10]|0,t6=0,v6=s[9]|0,t7=0,v7=s[8]|0,t8=0,v8=s[7]|0,t9=0,v9=s[6]|0,t10=0,v10=s[5]|0,t11=0,v11=s[4]|0,t12=0,v12=s[3]|0,t13=0,v13=s[2]|0,t14=0,v14=s[1]|0,t15=0,v15=s[0]|0;
|
|
2290
|
-
|
|
2291
|
-
for (i = 0; i < l;) {
|
|
2292
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2293
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2294
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2295
|
-
v0^=str.charCodeAt(i++);
|
|
2296
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2297
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2298
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2299
|
-
v0^=str.charCodeAt(i++);
|
|
2300
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2301
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2302
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2303
|
-
v0^=str.charCodeAt(i++);
|
|
2304
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2305
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2306
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2307
|
-
v0^=str.charCodeAt(i++);
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
while(i<l+3){
|
|
2311
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2312
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2313
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2314
|
-
v0^=str.charCodeAt(i++);
|
|
2315
|
-
}
|
|
2316
|
-
|
|
2317
|
-
return hashValHex(hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],256);
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
function _hash256_1a_utf(str){
|
|
2321
|
-
var c,i,l=str.length,s=fnvConstants[256].offset,t0=0,v0=s[15]|0,t1=0,v1=s[14]|0,t2=0,v2=s[13]|0,t3=0,v3=s[12]|0,t4=0,v4=s[11]|0,t5=0,v5=s[10]|0,t6=0,v6=s[9]|0,t7=0,v7=s[8]|0,t8=0,v8=s[7]|0,t9=0,v9=s[6]|0,t10=0,v10=s[5]|0,t11=0,v11=s[4]|0,t12=0,v12=s[3]|0,t13=0,v13=s[2]|0,t14=0,v14=s[1]|0,t15=0,v15=s[0]|0;
|
|
2322
|
-
|
|
2323
|
-
for (i = 0; i < l; i++) {
|
|
2324
|
-
c = str.charCodeAt(i);
|
|
2325
|
-
if(c < 128){
|
|
2326
|
-
v0^=c;
|
|
2327
|
-
}else if(c < 2048){
|
|
2328
|
-
v0^=(c>>6)|192;
|
|
2329
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2330
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2331
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2332
|
-
v0^=(c&63)|128;
|
|
2333
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2334
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2335
|
-
v0^=(c>>18)|240;
|
|
2336
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2337
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2338
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2339
|
-
v0^=((c>>12)&63)|128;
|
|
2340
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2341
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2342
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2343
|
-
v0^=((c>>6)&63)|128;
|
|
2344
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2345
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2346
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2347
|
-
v0^=(c&63)|128;
|
|
2348
|
-
}else{
|
|
2349
|
-
v0^=(c>>12)|224;
|
|
2350
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2351
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2352
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2353
|
-
v0^=((c>>6)&63)|128;
|
|
2354
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2355
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2356
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2357
|
-
v0^=(c&63)|128;
|
|
2358
|
-
}
|
|
2359
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2360
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2361
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2362
|
-
}
|
|
2363
|
-
|
|
2364
|
-
return hashValHex(hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],256);
|
|
2365
|
-
}
|
|
2366
|
-
|
|
2367
|
-
function _hash256_1_utf(str){
|
|
2368
|
-
var c,i,l=str.length,s=fnvConstants[256].offset,t0=0,v0=s[15]|0,t1=0,v1=s[14]|0,t2=0,v2=s[13]|0,t3=0,v3=s[12]|0,t4=0,v4=s[11]|0,t5=0,v5=s[10]|0,t6=0,v6=s[9]|0,t7=0,v7=s[8]|0,t8=0,v8=s[7]|0,t9=0,v9=s[6]|0,t10=0,v10=s[5]|0,t11=0,v11=s[4]|0,t12=0,v12=s[3]|0,t13=0,v13=s[2]|0,t14=0,v14=s[1]|0,t15=0,v15=s[0]|0;
|
|
2369
|
-
|
|
2370
|
-
for (i = 0; i < l; i++) {
|
|
2371
|
-
c = str.charCodeAt(i);
|
|
2372
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2373
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2374
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2375
|
-
if(c < 128){
|
|
2376
|
-
v0^=c;
|
|
2377
|
-
}else if(c < 2048){
|
|
2378
|
-
v0^=(c>>6)|192;
|
|
2379
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2380
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2381
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2382
|
-
v0^=(c&63)|128;
|
|
2383
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2384
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2385
|
-
v0^=(c>>18)|240;
|
|
2386
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2387
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2388
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2389
|
-
v0^=((c>>12)&63)|128;
|
|
2390
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2391
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2392
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2393
|
-
v0^=((c>>6)&63)|128;
|
|
2394
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2395
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2396
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2397
|
-
v0^=(c&63)|128;
|
|
2398
|
-
}else{
|
|
2399
|
-
v0^=(c>>12)|224;
|
|
2400
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2401
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2402
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2403
|
-
v0^=((c>>6)&63)|128;
|
|
2404
|
-
t0=v0*355;t1=v1*355;t2=v2*355;t3=v3*355;t4=v4*355;t5=v5*355;t6=v6*355;t7=v7*355;t8=v8*355;t9=v9*355;t10=v10*355;t11=v11*355;t12=v12*355;t13=v13*355;t14=v14*355;t15=v15*355;
|
|
2405
|
-
t10+=v0<<8;t11+=v1<<8;t12+=v2<<8;t13+=v3<<8;t14+=v4<<8;t15+=v5<<8;
|
|
2406
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;v15=(t15+(t14>>>16))&65535;v14=t14&65535;
|
|
2407
|
-
v0^=(c&63)|128;
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
|
|
2411
|
-
return hashValHex(hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],256);
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
|
-
_hash256 = _hash256_1a;
|
|
2415
|
-
|
|
2416
|
-
function _hash512_1a(str){
|
|
2417
|
-
var i,l=str.length-3,s=fnvConstants[512].offset,t0=0,v0=s[31]|0,t1=0,v1=s[30]|0,t2=0,v2=s[29]|0,t3=0,v3=s[28]|0,t4=0,v4=s[27]|0,t5=0,v5=s[26]|0,t6=0,v6=s[25]|0,t7=0,v7=s[24]|0,t8=0,v8=s[23]|0,t9=0,v9=s[22]|0,t10=0,v10=s[21]|0,t11=0,v11=s[20]|0,t12=0,v12=s[19]|0,t13=0,v13=s[18]|0,t14=0,v14=s[17]|0,t15=0,v15=s[16]|0,t16=0,v16=s[15]|0,t17=0,v17=s[14]|0,t18=0,v18=s[13]|0,t19=0,v19=s[12]|0,t20=0,v20=s[11]|0,t21=0,v21=s[10]|0,t22=0,v22=s[9]|0,t23=0,v23=s[8]|0,t24=0,v24=s[7]|0,t25=0,v25=s[6]|0,t26=0,v26=s[5]|0,t27=0,v27=s[4]|0,t28=0,v28=s[3]|0,t29=0,v29=s[2]|0,t30=0,v30=s[1]|0,t31=0,v31=s[0]|0;
|
|
2418
|
-
|
|
2419
|
-
for (i = 0; i < l;) {
|
|
2420
|
-
v0^=str.charCodeAt(i++);
|
|
2421
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2422
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2423
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2424
|
-
v0^=str.charCodeAt(i++);
|
|
2425
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2426
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2427
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2428
|
-
v0^=str.charCodeAt(i++);
|
|
2429
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2430
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2431
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2432
|
-
v0^=str.charCodeAt(i++);
|
|
2433
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2434
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2435
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
|
-
while(i<l+3){
|
|
2439
|
-
v0^=str.charCodeAt(i++);
|
|
2440
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2441
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2442
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2443
|
-
}
|
|
2444
|
-
|
|
2445
|
-
return hashValHex(hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],512);
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
|
-
function _hash512_1(str){
|
|
2449
|
-
var i,l=str.length-3,s=fnvConstants[512].offset,t0=0,v0=s[31]|0,t1=0,v1=s[30]|0,t2=0,v2=s[29]|0,t3=0,v3=s[28]|0,t4=0,v4=s[27]|0,t5=0,v5=s[26]|0,t6=0,v6=s[25]|0,t7=0,v7=s[24]|0,t8=0,v8=s[23]|0,t9=0,v9=s[22]|0,t10=0,v10=s[21]|0,t11=0,v11=s[20]|0,t12=0,v12=s[19]|0,t13=0,v13=s[18]|0,t14=0,v14=s[17]|0,t15=0,v15=s[16]|0,t16=0,v16=s[15]|0,t17=0,v17=s[14]|0,t18=0,v18=s[13]|0,t19=0,v19=s[12]|0,t20=0,v20=s[11]|0,t21=0,v21=s[10]|0,t22=0,v22=s[9]|0,t23=0,v23=s[8]|0,t24=0,v24=s[7]|0,t25=0,v25=s[6]|0,t26=0,v26=s[5]|0,t27=0,v27=s[4]|0,t28=0,v28=s[3]|0,t29=0,v29=s[2]|0,t30=0,v30=s[1]|0,t31=0,v31=s[0]|0;
|
|
2450
|
-
|
|
2451
|
-
for (i = 0; i < l;) {
|
|
2452
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2453
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2454
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2455
|
-
v0^=str.charCodeAt(i++);
|
|
2456
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2457
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2458
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2459
|
-
v0^=str.charCodeAt(i++);
|
|
2460
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2461
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2462
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2463
|
-
v0^=str.charCodeAt(i++);
|
|
2464
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2465
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2466
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2467
|
-
v0^=str.charCodeAt(i++);
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
while(i<l+3){
|
|
2471
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2472
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2473
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2474
|
-
v0^=str.charCodeAt(i++);
|
|
2475
|
-
}
|
|
2476
|
-
|
|
2477
|
-
return hashValHex(hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],512);
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
function _hash512_1a_utf(str){
|
|
2481
|
-
var c,i,l=str.length,s=fnvConstants[512].offset,t0=0,v0=s[31]|0,t1=0,v1=s[30]|0,t2=0,v2=s[29]|0,t3=0,v3=s[28]|0,t4=0,v4=s[27]|0,t5=0,v5=s[26]|0,t6=0,v6=s[25]|0,t7=0,v7=s[24]|0,t8=0,v8=s[23]|0,t9=0,v9=s[22]|0,t10=0,v10=s[21]|0,t11=0,v11=s[20]|0,t12=0,v12=s[19]|0,t13=0,v13=s[18]|0,t14=0,v14=s[17]|0,t15=0,v15=s[16]|0,t16=0,v16=s[15]|0,t17=0,v17=s[14]|0,t18=0,v18=s[13]|0,t19=0,v19=s[12]|0,t20=0,v20=s[11]|0,t21=0,v21=s[10]|0,t22=0,v22=s[9]|0,t23=0,v23=s[8]|0,t24=0,v24=s[7]|0,t25=0,v25=s[6]|0,t26=0,v26=s[5]|0,t27=0,v27=s[4]|0,t28=0,v28=s[3]|0,t29=0,v29=s[2]|0,t30=0,v30=s[1]|0,t31=0,v31=s[0]|0;
|
|
2482
|
-
|
|
2483
|
-
for (i = 0; i < l; i++) {
|
|
2484
|
-
c = str.charCodeAt(i);
|
|
2485
|
-
if(c < 128){
|
|
2486
|
-
v0^=c;
|
|
2487
|
-
}else if(c < 2048){
|
|
2488
|
-
v0^=(c>>6)|192;
|
|
2489
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2490
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2491
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2492
|
-
v0^=(c&63)|128;
|
|
2493
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2494
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2495
|
-
v0^=(c>>18)|240;
|
|
2496
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2497
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2498
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2499
|
-
v0^=((c>>12)&63)|128;
|
|
2500
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2501
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2502
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2503
|
-
v0^=((c>>6)&63)|128;
|
|
2504
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2505
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2506
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2507
|
-
v0^=(c&63)|128;
|
|
2508
|
-
}else{
|
|
2509
|
-
v0^=(c>>12)|224;
|
|
2510
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2511
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2512
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2513
|
-
v0^=((c>>6)&63)|128;
|
|
2514
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2515
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2516
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2517
|
-
v0^=(c&63)|128;
|
|
2518
|
-
}
|
|
2519
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2520
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2521
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2522
|
-
}
|
|
2523
|
-
|
|
2524
|
-
return hashValHex(hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],512);
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
function _hash512_1_utf(str){
|
|
2528
|
-
var c,i,l=str.length,s=fnvConstants[512].offset,t0=0,v0=s[31]|0,t1=0,v1=s[30]|0,t2=0,v2=s[29]|0,t3=0,v3=s[28]|0,t4=0,v4=s[27]|0,t5=0,v5=s[26]|0,t6=0,v6=s[25]|0,t7=0,v7=s[24]|0,t8=0,v8=s[23]|0,t9=0,v9=s[22]|0,t10=0,v10=s[21]|0,t11=0,v11=s[20]|0,t12=0,v12=s[19]|0,t13=0,v13=s[18]|0,t14=0,v14=s[17]|0,t15=0,v15=s[16]|0,t16=0,v16=s[15]|0,t17=0,v17=s[14]|0,t18=0,v18=s[13]|0,t19=0,v19=s[12]|0,t20=0,v20=s[11]|0,t21=0,v21=s[10]|0,t22=0,v22=s[9]|0,t23=0,v23=s[8]|0,t24=0,v24=s[7]|0,t25=0,v25=s[6]|0,t26=0,v26=s[5]|0,t27=0,v27=s[4]|0,t28=0,v28=s[3]|0,t29=0,v29=s[2]|0,t30=0,v30=s[1]|0,t31=0,v31=s[0]|0;
|
|
2529
|
-
|
|
2530
|
-
for (i = 0; i < l; i++) {
|
|
2531
|
-
c = str.charCodeAt(i);
|
|
2532
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2533
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2534
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2535
|
-
if(c < 128){
|
|
2536
|
-
v0^=c;
|
|
2537
|
-
}else if(c < 2048){
|
|
2538
|
-
v0^=(c>>6)|192;
|
|
2539
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2540
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2541
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2542
|
-
v0^=(c&63)|128;
|
|
2543
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2544
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2545
|
-
v0^=(c>>18)|240;
|
|
2546
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2547
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2548
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2549
|
-
v0^=((c>>12)&63)|128;
|
|
2550
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2551
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2552
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2553
|
-
v0^=((c>>6)&63)|128;
|
|
2554
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2555
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2556
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2557
|
-
v0^=(c&63)|128;
|
|
2558
|
-
}else{
|
|
2559
|
-
v0^=(c>>12)|224;
|
|
2560
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2561
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2562
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2563
|
-
v0^=((c>>6)&63)|128;
|
|
2564
|
-
t0=v0*343;t1=v1*343;t2=v2*343;t3=v3*343;t4=v4*343;t5=v5*343;t6=v6*343;t7=v7*343;t8=v8*343;t9=v9*343;t10=v10*343;t11=v11*343;t12=v12*343;t13=v13*343;t14=v14*343;t15=v15*343;t16=v16*343;t17=v17*343;t18=v18*343;t19=v19*343;t20=v20*343;t21=v21*343;t22=v22*343;t23=v23*343;t24=v24*343;t25=v25*343;t26=v26*343;t27=v27*343;t28=v28*343;t29=v29*343;t30=v30*343;t31=v31*343;
|
|
2565
|
-
t21+=v0<<8;t22+=v1<<8;t23+=v2<<8;t24+=v3<<8;t25+=v4<<8;t26+=v5<<8;t27+=v6<<8;t28+=v7<<8;t29+=v8<<8;t30+=v9<<8;t31+=v10<<8;
|
|
2566
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;v31=(t31+(t30>>>16))&65535;v30=t30&65535;
|
|
2567
|
-
v0^=(c&63)|128;
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
|
|
2571
|
-
return hashValHex(hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],512);
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2574
|
-
_hash512 = _hash512_1a;
|
|
2575
|
-
|
|
2576
|
-
function _hash1024_1a(str){
|
|
2577
|
-
var i,l=str.length-3,s=fnvConstants[1024].offset,t0=0,v0=s[63]|0,t1=0,v1=s[62]|0,t2=0,v2=s[61]|0,t3=0,v3=s[60]|0,t4=0,v4=s[59]|0,t5=0,v5=s[58]|0,t6=0,v6=s[57]|0,t7=0,v7=s[56]|0,t8=0,v8=s[55]|0,t9=0,v9=s[54]|0,t10=0,v10=s[53]|0,t11=0,v11=s[52]|0,t12=0,v12=s[51]|0,t13=0,v13=s[50]|0,t14=0,v14=s[49]|0,t15=0,v15=s[48]|0,t16=0,v16=s[47]|0,t17=0,v17=s[46]|0,t18=0,v18=s[45]|0,t19=0,v19=s[44]|0,t20=0,v20=s[43]|0,t21=0,v21=s[42]|0,t22=0,v22=s[41]|0,t23=0,v23=s[40]|0,t24=0,v24=s[39]|0,t25=0,v25=s[38]|0,t26=0,v26=s[37]|0,t27=0,v27=s[36]|0,t28=0,v28=s[35]|0,t29=0,v29=s[34]|0,t30=0,v30=s[33]|0,t31=0,v31=s[32]|0,t32=0,v32=s[31]|0,t33=0,v33=s[30]|0,t34=0,v34=s[29]|0,t35=0,v35=s[28]|0,t36=0,v36=s[27]|0,t37=0,v37=s[26]|0,t38=0,v38=s[25]|0,t39=0,v39=s[24]|0,t40=0,v40=s[23]|0,t41=0,v41=s[22]|0,t42=0,v42=s[21]|0,t43=0,v43=s[20]|0,t44=0,v44=s[19]|0,t45=0,v45=s[18]|0,t46=0,v46=s[17]|0,t47=0,v47=s[16]|0,t48=0,v48=s[15]|0,t49=0,v49=s[14]|0,t50=0,v50=s[13]|0,t51=0,v51=s[12]|0,t52=0,v52=s[11]|0,t53=0,v53=s[10]|0,t54=0,v54=s[9]|0,t55=0,v55=s[8]|0,t56=0,v56=s[7]|0,t57=0,v57=s[6]|0,t58=0,v58=s[5]|0,t59=0,v59=s[4]|0,t60=0,v60=s[3]|0,t61=0,v61=s[2]|0,t62=0,v62=s[1]|0,t63=0,v63=s[0]|0;
|
|
2578
|
-
|
|
2579
|
-
for (i = 0; i < l;) {
|
|
2580
|
-
v0^=str.charCodeAt(i++);
|
|
2581
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2582
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2583
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2584
|
-
v0^=str.charCodeAt(i++);
|
|
2585
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2586
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2587
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2588
|
-
v0^=str.charCodeAt(i++);
|
|
2589
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2590
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2591
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2592
|
-
v0^=str.charCodeAt(i++);
|
|
2593
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2594
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2595
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2596
|
-
}
|
|
2597
|
-
|
|
2598
|
-
while(i<l+3){
|
|
2599
|
-
v0^=str.charCodeAt(i++);
|
|
2600
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2601
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2602
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2603
|
-
}
|
|
2604
|
-
|
|
2605
|
-
return hashValHex(hl[v63>>8]+hl[v63&255]+hl[v62>>8]+hl[v62&255]+hl[v61>>8]+hl[v61&255]+hl[v60>>8]+hl[v60&255]+hl[v59>>8]+hl[v59&255]+hl[v58>>8]+hl[v58&255]+hl[v57>>8]+hl[v57&255]+hl[v56>>8]+hl[v56&255]+hl[v55>>8]+hl[v55&255]+hl[v54>>8]+hl[v54&255]+hl[v53>>8]+hl[v53&255]+hl[v52>>8]+hl[v52&255]+hl[v51>>8]+hl[v51&255]+hl[v50>>8]+hl[v50&255]+hl[v49>>8]+hl[v49&255]+hl[v48>>8]+hl[v48&255]+hl[v47>>8]+hl[v47&255]+hl[v46>>8]+hl[v46&255]+hl[v45>>8]+hl[v45&255]+hl[v44>>8]+hl[v44&255]+hl[v43>>8]+hl[v43&255]+hl[v42>>8]+hl[v42&255]+hl[v41>>8]+hl[v41&255]+hl[v40>>8]+hl[v40&255]+hl[v39>>8]+hl[v39&255]+hl[v38>>8]+hl[v38&255]+hl[v37>>8]+hl[v37&255]+hl[v36>>8]+hl[v36&255]+hl[v35>>8]+hl[v35&255]+hl[v34>>8]+hl[v34&255]+hl[v33>>8]+hl[v33&255]+hl[v32>>8]+hl[v32&255]+hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],1024);
|
|
2606
|
-
}
|
|
2607
|
-
|
|
2608
|
-
function _hash1024_1(str){
|
|
2609
|
-
var i,l=str.length-3,s=fnvConstants[1024].offset,t0=0,v0=s[63]|0,t1=0,v1=s[62]|0,t2=0,v2=s[61]|0,t3=0,v3=s[60]|0,t4=0,v4=s[59]|0,t5=0,v5=s[58]|0,t6=0,v6=s[57]|0,t7=0,v7=s[56]|0,t8=0,v8=s[55]|0,t9=0,v9=s[54]|0,t10=0,v10=s[53]|0,t11=0,v11=s[52]|0,t12=0,v12=s[51]|0,t13=0,v13=s[50]|0,t14=0,v14=s[49]|0,t15=0,v15=s[48]|0,t16=0,v16=s[47]|0,t17=0,v17=s[46]|0,t18=0,v18=s[45]|0,t19=0,v19=s[44]|0,t20=0,v20=s[43]|0,t21=0,v21=s[42]|0,t22=0,v22=s[41]|0,t23=0,v23=s[40]|0,t24=0,v24=s[39]|0,t25=0,v25=s[38]|0,t26=0,v26=s[37]|0,t27=0,v27=s[36]|0,t28=0,v28=s[35]|0,t29=0,v29=s[34]|0,t30=0,v30=s[33]|0,t31=0,v31=s[32]|0,t32=0,v32=s[31]|0,t33=0,v33=s[30]|0,t34=0,v34=s[29]|0,t35=0,v35=s[28]|0,t36=0,v36=s[27]|0,t37=0,v37=s[26]|0,t38=0,v38=s[25]|0,t39=0,v39=s[24]|0,t40=0,v40=s[23]|0,t41=0,v41=s[22]|0,t42=0,v42=s[21]|0,t43=0,v43=s[20]|0,t44=0,v44=s[19]|0,t45=0,v45=s[18]|0,t46=0,v46=s[17]|0,t47=0,v47=s[16]|0,t48=0,v48=s[15]|0,t49=0,v49=s[14]|0,t50=0,v50=s[13]|0,t51=0,v51=s[12]|0,t52=0,v52=s[11]|0,t53=0,v53=s[10]|0,t54=0,v54=s[9]|0,t55=0,v55=s[8]|0,t56=0,v56=s[7]|0,t57=0,v57=s[6]|0,t58=0,v58=s[5]|0,t59=0,v59=s[4]|0,t60=0,v60=s[3]|0,t61=0,v61=s[2]|0,t62=0,v62=s[1]|0,t63=0,v63=s[0]|0;
|
|
2610
|
-
|
|
2611
|
-
for (i = 0; i < l;) {
|
|
2612
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2613
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2614
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2615
|
-
v0^=str.charCodeAt(i++);
|
|
2616
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2617
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2618
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2619
|
-
v0^=str.charCodeAt(i++);
|
|
2620
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2621
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2622
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2623
|
-
v0^=str.charCodeAt(i++);
|
|
2624
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2625
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2626
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2627
|
-
v0^=str.charCodeAt(i++);
|
|
2628
|
-
}
|
|
2629
|
-
|
|
2630
|
-
while(i<l+3){
|
|
2631
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2632
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2633
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2634
|
-
v0^=str.charCodeAt(i++);
|
|
2635
|
-
}
|
|
2636
|
-
|
|
2637
|
-
return hashValHex(hl[v63>>8]+hl[v63&255]+hl[v62>>8]+hl[v62&255]+hl[v61>>8]+hl[v61&255]+hl[v60>>8]+hl[v60&255]+hl[v59>>8]+hl[v59&255]+hl[v58>>8]+hl[v58&255]+hl[v57>>8]+hl[v57&255]+hl[v56>>8]+hl[v56&255]+hl[v55>>8]+hl[v55&255]+hl[v54>>8]+hl[v54&255]+hl[v53>>8]+hl[v53&255]+hl[v52>>8]+hl[v52&255]+hl[v51>>8]+hl[v51&255]+hl[v50>>8]+hl[v50&255]+hl[v49>>8]+hl[v49&255]+hl[v48>>8]+hl[v48&255]+hl[v47>>8]+hl[v47&255]+hl[v46>>8]+hl[v46&255]+hl[v45>>8]+hl[v45&255]+hl[v44>>8]+hl[v44&255]+hl[v43>>8]+hl[v43&255]+hl[v42>>8]+hl[v42&255]+hl[v41>>8]+hl[v41&255]+hl[v40>>8]+hl[v40&255]+hl[v39>>8]+hl[v39&255]+hl[v38>>8]+hl[v38&255]+hl[v37>>8]+hl[v37&255]+hl[v36>>8]+hl[v36&255]+hl[v35>>8]+hl[v35&255]+hl[v34>>8]+hl[v34&255]+hl[v33>>8]+hl[v33&255]+hl[v32>>8]+hl[v32&255]+hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],1024);
|
|
2638
|
-
}
|
|
2639
|
-
|
|
2640
|
-
function _hash1024_1a_utf(str){
|
|
2641
|
-
var c,i,l=str.length,s=fnvConstants[1024].offset,t0=0,v0=s[63]|0,t1=0,v1=s[62]|0,t2=0,v2=s[61]|0,t3=0,v3=s[60]|0,t4=0,v4=s[59]|0,t5=0,v5=s[58]|0,t6=0,v6=s[57]|0,t7=0,v7=s[56]|0,t8=0,v8=s[55]|0,t9=0,v9=s[54]|0,t10=0,v10=s[53]|0,t11=0,v11=s[52]|0,t12=0,v12=s[51]|0,t13=0,v13=s[50]|0,t14=0,v14=s[49]|0,t15=0,v15=s[48]|0,t16=0,v16=s[47]|0,t17=0,v17=s[46]|0,t18=0,v18=s[45]|0,t19=0,v19=s[44]|0,t20=0,v20=s[43]|0,t21=0,v21=s[42]|0,t22=0,v22=s[41]|0,t23=0,v23=s[40]|0,t24=0,v24=s[39]|0,t25=0,v25=s[38]|0,t26=0,v26=s[37]|0,t27=0,v27=s[36]|0,t28=0,v28=s[35]|0,t29=0,v29=s[34]|0,t30=0,v30=s[33]|0,t31=0,v31=s[32]|0,t32=0,v32=s[31]|0,t33=0,v33=s[30]|0,t34=0,v34=s[29]|0,t35=0,v35=s[28]|0,t36=0,v36=s[27]|0,t37=0,v37=s[26]|0,t38=0,v38=s[25]|0,t39=0,v39=s[24]|0,t40=0,v40=s[23]|0,t41=0,v41=s[22]|0,t42=0,v42=s[21]|0,t43=0,v43=s[20]|0,t44=0,v44=s[19]|0,t45=0,v45=s[18]|0,t46=0,v46=s[17]|0,t47=0,v47=s[16]|0,t48=0,v48=s[15]|0,t49=0,v49=s[14]|0,t50=0,v50=s[13]|0,t51=0,v51=s[12]|0,t52=0,v52=s[11]|0,t53=0,v53=s[10]|0,t54=0,v54=s[9]|0,t55=0,v55=s[8]|0,t56=0,v56=s[7]|0,t57=0,v57=s[6]|0,t58=0,v58=s[5]|0,t59=0,v59=s[4]|0,t60=0,v60=s[3]|0,t61=0,v61=s[2]|0,t62=0,v62=s[1]|0,t63=0,v63=s[0]|0;
|
|
2642
|
-
|
|
2643
|
-
for (i = 0; i < l; i++) {
|
|
2644
|
-
c = str.charCodeAt(i);
|
|
2645
|
-
if(c < 128){
|
|
2646
|
-
v0^=c;
|
|
2647
|
-
}else if(c < 2048){
|
|
2648
|
-
v0^=(c>>6)|192;
|
|
2649
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2650
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2651
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2652
|
-
v0^=(c&63)|128;
|
|
2653
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2654
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2655
|
-
v0^=(c>>18)|240;
|
|
2656
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2657
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2658
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2659
|
-
v0^=((c>>12)&63)|128;
|
|
2660
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2661
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2662
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2663
|
-
v0^=((c>>6)&63)|128;
|
|
2664
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2665
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2666
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2667
|
-
v0^=(c&63)|128;
|
|
2668
|
-
}else{
|
|
2669
|
-
v0^=(c>>12)|224;
|
|
2670
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2671
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2672
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2673
|
-
v0^=((c>>6)&63)|128;
|
|
2674
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2675
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2676
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2677
|
-
v0^=(c&63)|128;
|
|
2678
|
-
}
|
|
2679
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2680
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2681
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
return hashValHex(hl[v63>>8]+hl[v63&255]+hl[v62>>8]+hl[v62&255]+hl[v61>>8]+hl[v61&255]+hl[v60>>8]+hl[v60&255]+hl[v59>>8]+hl[v59&255]+hl[v58>>8]+hl[v58&255]+hl[v57>>8]+hl[v57&255]+hl[v56>>8]+hl[v56&255]+hl[v55>>8]+hl[v55&255]+hl[v54>>8]+hl[v54&255]+hl[v53>>8]+hl[v53&255]+hl[v52>>8]+hl[v52&255]+hl[v51>>8]+hl[v51&255]+hl[v50>>8]+hl[v50&255]+hl[v49>>8]+hl[v49&255]+hl[v48>>8]+hl[v48&255]+hl[v47>>8]+hl[v47&255]+hl[v46>>8]+hl[v46&255]+hl[v45>>8]+hl[v45&255]+hl[v44>>8]+hl[v44&255]+hl[v43>>8]+hl[v43&255]+hl[v42>>8]+hl[v42&255]+hl[v41>>8]+hl[v41&255]+hl[v40>>8]+hl[v40&255]+hl[v39>>8]+hl[v39&255]+hl[v38>>8]+hl[v38&255]+hl[v37>>8]+hl[v37&255]+hl[v36>>8]+hl[v36&255]+hl[v35>>8]+hl[v35&255]+hl[v34>>8]+hl[v34&255]+hl[v33>>8]+hl[v33&255]+hl[v32>>8]+hl[v32&255]+hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],1024);
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
function _hash1024_1_utf(str){
|
|
2688
|
-
var c,i,l=str.length,s=fnvConstants[1024].offset,t0=0,v0=s[63]|0,t1=0,v1=s[62]|0,t2=0,v2=s[61]|0,t3=0,v3=s[60]|0,t4=0,v4=s[59]|0,t5=0,v5=s[58]|0,t6=0,v6=s[57]|0,t7=0,v7=s[56]|0,t8=0,v8=s[55]|0,t9=0,v9=s[54]|0,t10=0,v10=s[53]|0,t11=0,v11=s[52]|0,t12=0,v12=s[51]|0,t13=0,v13=s[50]|0,t14=0,v14=s[49]|0,t15=0,v15=s[48]|0,t16=0,v16=s[47]|0,t17=0,v17=s[46]|0,t18=0,v18=s[45]|0,t19=0,v19=s[44]|0,t20=0,v20=s[43]|0,t21=0,v21=s[42]|0,t22=0,v22=s[41]|0,t23=0,v23=s[40]|0,t24=0,v24=s[39]|0,t25=0,v25=s[38]|0,t26=0,v26=s[37]|0,t27=0,v27=s[36]|0,t28=0,v28=s[35]|0,t29=0,v29=s[34]|0,t30=0,v30=s[33]|0,t31=0,v31=s[32]|0,t32=0,v32=s[31]|0,t33=0,v33=s[30]|0,t34=0,v34=s[29]|0,t35=0,v35=s[28]|0,t36=0,v36=s[27]|0,t37=0,v37=s[26]|0,t38=0,v38=s[25]|0,t39=0,v39=s[24]|0,t40=0,v40=s[23]|0,t41=0,v41=s[22]|0,t42=0,v42=s[21]|0,t43=0,v43=s[20]|0,t44=0,v44=s[19]|0,t45=0,v45=s[18]|0,t46=0,v46=s[17]|0,t47=0,v47=s[16]|0,t48=0,v48=s[15]|0,t49=0,v49=s[14]|0,t50=0,v50=s[13]|0,t51=0,v51=s[12]|0,t52=0,v52=s[11]|0,t53=0,v53=s[10]|0,t54=0,v54=s[9]|0,t55=0,v55=s[8]|0,t56=0,v56=s[7]|0,t57=0,v57=s[6]|0,t58=0,v58=s[5]|0,t59=0,v59=s[4]|0,t60=0,v60=s[3]|0,t61=0,v61=s[2]|0,t62=0,v62=s[1]|0,t63=0,v63=s[0]|0;
|
|
2689
|
-
|
|
2690
|
-
for (i = 0; i < l; i++) {
|
|
2691
|
-
c = str.charCodeAt(i);
|
|
2692
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2693
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2694
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2695
|
-
if(c < 128){
|
|
2696
|
-
v0^=c;
|
|
2697
|
-
}else if(c < 2048){
|
|
2698
|
-
v0^=(c>>6)|192;
|
|
2699
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2700
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2701
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2702
|
-
v0^=(c&63)|128;
|
|
2703
|
-
}else if(((c&64512)==55296)&&(i+1)<l&&((str.charCodeAt(i+1)&64512)==56320)){
|
|
2704
|
-
c=65536+((c&1023)<<10)+(str.charCodeAt(++i)&1023);
|
|
2705
|
-
v0^=(c>>18)|240;
|
|
2706
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2707
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2708
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2709
|
-
v0^=((c>>12)&63)|128;
|
|
2710
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2711
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2712
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2713
|
-
v0^=((c>>6)&63)|128;
|
|
2714
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2715
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2716
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2717
|
-
v0^=(c&63)|128;
|
|
2718
|
-
}else{
|
|
2719
|
-
v0^=(c>>12)|224;
|
|
2720
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2721
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2722
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2723
|
-
v0^=((c>>6)&63)|128;
|
|
2724
|
-
t0=v0*397;t1=v1*397;t2=v2*397;t3=v3*397;t4=v4*397;t5=v5*397;t6=v6*397;t7=v7*397;t8=v8*397;t9=v9*397;t10=v10*397;t11=v11*397;t12=v12*397;t13=v13*397;t14=v14*397;t15=v15*397;t16=v16*397;t17=v17*397;t18=v18*397;t19=v19*397;t20=v20*397;t21=v21*397;t22=v22*397;t23=v23*397;t24=v24*397;t25=v25*397;t26=v26*397;t27=v27*397;t28=v28*397;t29=v29*397;t30=v30*397;t31=v31*397;t32=v32*397;t33=v33*397;t34=v34*397;t35=v35*397;t36=v36*397;t37=v37*397;t38=v38*397;t39=v39*397;t40=v40*397;t41=v41*397;t42=v42*397;t43=v43*397;t44=v44*397;t45=v45*397;t46=v46*397;t47=v47*397;t48=v48*397;t49=v49*397;t50=v50*397;t51=v51*397;t52=v52*397;t53=v53*397;t54=v54*397;t55=v55*397;t56=v56*397;t57=v57*397;t58=v58*397;t59=v59*397;t60=v60*397;t61=v61*397;t62=v62*397;t63=v63*397;
|
|
2725
|
-
t42+=v0<<8;t43+=v1<<8;t44+=v2<<8;t45+=v3<<8;t46+=v4<<8;t47+=v5<<8;t48+=v6<<8;t49+=v7<<8;t50+=v8<<8;t51+=v9<<8;t52+=v10<<8;t53+=v11<<8;t54+=v12<<8;t55+=v13<<8;t56+=v14<<8;t57+=v15<<8;t58+=v16<<8;t59+=v17<<8;t60+=v18<<8;t61+=v19<<8;t62+=v20<<8;t63+=v21<<8;
|
|
2726
|
-
t1+=t0>>>16;v0=t0&65535;t2+=t1>>>16;v1=t1&65535;t3+=t2>>>16;v2=t2&65535;t4+=t3>>>16;v3=t3&65535;t5+=t4>>>16;v4=t4&65535;t6+=t5>>>16;v5=t5&65535;t7+=t6>>>16;v6=t6&65535;t8+=t7>>>16;v7=t7&65535;t9+=t8>>>16;v8=t8&65535;t10+=t9>>>16;v9=t9&65535;t11+=t10>>>16;v10=t10&65535;t12+=t11>>>16;v11=t11&65535;t13+=t12>>>16;v12=t12&65535;t14+=t13>>>16;v13=t13&65535;t15+=t14>>>16;v14=t14&65535;t16+=t15>>>16;v15=t15&65535;t17+=t16>>>16;v16=t16&65535;t18+=t17>>>16;v17=t17&65535;t19+=t18>>>16;v18=t18&65535;t20+=t19>>>16;v19=t19&65535;t21+=t20>>>16;v20=t20&65535;t22+=t21>>>16;v21=t21&65535;t23+=t22>>>16;v22=t22&65535;t24+=t23>>>16;v23=t23&65535;t25+=t24>>>16;v24=t24&65535;t26+=t25>>>16;v25=t25&65535;t27+=t26>>>16;v26=t26&65535;t28+=t27>>>16;v27=t27&65535;t29+=t28>>>16;v28=t28&65535;t30+=t29>>>16;v29=t29&65535;t31+=t30>>>16;v30=t30&65535;t32+=t31>>>16;v31=t31&65535;t33+=t32>>>16;v32=t32&65535;t34+=t33>>>16;v33=t33&65535;t35+=t34>>>16;v34=t34&65535;t36+=t35>>>16;v35=t35&65535;t37+=t36>>>16;v36=t36&65535;t38+=t37>>>16;v37=t37&65535;t39+=t38>>>16;v38=t38&65535;t40+=t39>>>16;v39=t39&65535;t41+=t40>>>16;v40=t40&65535;t42+=t41>>>16;v41=t41&65535;t43+=t42>>>16;v42=t42&65535;t44+=t43>>>16;v43=t43&65535;t45+=t44>>>16;v44=t44&65535;t46+=t45>>>16;v45=t45&65535;t47+=t46>>>16;v46=t46&65535;t48+=t47>>>16;v47=t47&65535;t49+=t48>>>16;v48=t48&65535;t50+=t49>>>16;v49=t49&65535;t51+=t50>>>16;v50=t50&65535;t52+=t51>>>16;v51=t51&65535;t53+=t52>>>16;v52=t52&65535;t54+=t53>>>16;v53=t53&65535;t55+=t54>>>16;v54=t54&65535;t56+=t55>>>16;v55=t55&65535;t57+=t56>>>16;v56=t56&65535;t58+=t57>>>16;v57=t57&65535;t59+=t58>>>16;v58=t58&65535;t60+=t59>>>16;v59=t59&65535;t61+=t60>>>16;v60=t60&65535;t62+=t61>>>16;v61=t61&65535;v63=(t63+(t62>>>16))&65535;v62=t62&65535;
|
|
2727
|
-
v0^=(c&63)|128;
|
|
2728
|
-
}
|
|
2729
|
-
}
|
|
2730
|
-
|
|
2731
|
-
return hashValHex(hl[v63>>8]+hl[v63&255]+hl[v62>>8]+hl[v62&255]+hl[v61>>8]+hl[v61&255]+hl[v60>>8]+hl[v60&255]+hl[v59>>8]+hl[v59&255]+hl[v58>>8]+hl[v58&255]+hl[v57>>8]+hl[v57&255]+hl[v56>>8]+hl[v56&255]+hl[v55>>8]+hl[v55&255]+hl[v54>>8]+hl[v54&255]+hl[v53>>8]+hl[v53&255]+hl[v52>>8]+hl[v52&255]+hl[v51>>8]+hl[v51&255]+hl[v50>>8]+hl[v50&255]+hl[v49>>8]+hl[v49&255]+hl[v48>>8]+hl[v48&255]+hl[v47>>8]+hl[v47&255]+hl[v46>>8]+hl[v46&255]+hl[v45>>8]+hl[v45&255]+hl[v44>>8]+hl[v44&255]+hl[v43>>8]+hl[v43&255]+hl[v42>>8]+hl[v42&255]+hl[v41>>8]+hl[v41&255]+hl[v40>>8]+hl[v40&255]+hl[v39>>8]+hl[v39&255]+hl[v38>>8]+hl[v38&255]+hl[v37>>8]+hl[v37&255]+hl[v36>>8]+hl[v36&255]+hl[v35>>8]+hl[v35&255]+hl[v34>>8]+hl[v34&255]+hl[v33>>8]+hl[v33&255]+hl[v32>>8]+hl[v32&255]+hl[v31>>8]+hl[v31&255]+hl[v30>>8]+hl[v30&255]+hl[v29>>8]+hl[v29&255]+hl[v28>>8]+hl[v28&255]+hl[v27>>8]+hl[v27&255]+hl[v26>>8]+hl[v26&255]+hl[v25>>8]+hl[v25&255]+hl[v24>>8]+hl[v24&255]+hl[v23>>8]+hl[v23&255]+hl[v22>>8]+hl[v22&255]+hl[v21>>8]+hl[v21&255]+hl[v20>>8]+hl[v20&255]+hl[v19>>8]+hl[v19&255]+hl[v18>>8]+hl[v18&255]+hl[v17>>8]+hl[v17&255]+hl[v16>>8]+hl[v16&255]+hl[v15>>8]+hl[v15&255]+hl[v14>>8]+hl[v14&255]+hl[v13>>8]+hl[v13&255]+hl[v12>>8]+hl[v12&255]+hl[v11>>8]+hl[v11&255]+hl[v10>>8]+hl[v10&255]+hl[v9>>8]+hl[v9&255]+hl[v8>>8]+hl[v8&255]+hl[v7>>8]+hl[v7&255]+hl[v6>>8]+hl[v6&255]+hl[v5>>8]+hl[v5&255]+hl[v4>>8]+hl[v4&255]+hl[v3>>8]+hl[v3&255]+hl[v2>>8]+hl[v2&255]+hl[v1>>8]+hl[v1&255]+hl[v0>>8]+hl[v0&255],1024);
|
|
2732
|
-
}
|
|
2733
|
-
|
|
2734
|
-
_hash1024 = _hash1024_1a;
|
|
2735
|
-
|
|
2736
|
-
// Init library.
|
|
2737
|
-
setVersion('1a');
|
|
2738
|
-
setUTF8(false);
|
|
2739
|
-
seed();
|
|
2740
|
-
|
|
2741
|
-
return {
|
|
2742
|
-
hash: hash,
|
|
2743
|
-
setKeyspace: setKeyspace,
|
|
2744
|
-
version: setVersion,
|
|
2745
|
-
useUTF8: setUTF8,
|
|
2746
|
-
seed: seed,
|
|
2747
|
-
fast1a32: _hash32_1a_fast,
|
|
2748
|
-
fast1a32hex:_hash32_1a_fast_hex,
|
|
2749
|
-
fast1a52: _hash52_1a_fast,
|
|
2750
|
-
fast1a52hex: _hash52_1a_fast_hex,
|
|
2751
|
-
fast1a64: _hash64_1a_fast,
|
|
2752
|
-
fast1a32utf: _hash32_1a_fast_utf,
|
|
2753
|
-
fast1a32hexutf:_hash32_1a_fast_hex_utf,
|
|
2754
|
-
fast1a52utf: _hash52_1a_fast_utf,
|
|
2755
|
-
fast1a52hexutf: _hash52_1a_fast_hex_utf,
|
|
2756
|
-
fast1a64utf: _hash64_1a_fast_utf
|
|
2757
|
-
};
|
|
2758
|
-
})();
|
|
2759
|
-
|
|
2760
|
-
if ( true && typeof module.exports != "undefined") module.exports = fnvplus;
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
/***/ }),
|
|
2764
|
-
/* 8 */
|
|
2765
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2766
|
-
|
|
2767
|
-
"use strict";
|
|
2768
|
-
|
|
2769
|
-
/*---------------------------------------------------------------------------------------------
|
|
2770
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2771
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
2772
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2773
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2774
|
-
exports.ensureAllNewCellsHaveCellIds = void 0;
|
|
2775
|
-
const vscode_1 = __webpack_require__(1);
|
|
2776
|
-
const serializers_1 = __webpack_require__(6);
|
|
2777
|
-
const notebookSerializer_1 = __webpack_require__(2);
|
|
2778
|
-
/**
|
|
2779
|
-
* Ensure all new cells in notebooks with nbformat >= 4.5 have an id.
|
|
2780
|
-
* Details of the spec can be found here https://jupyter.org/enhancement-proposals/62-cell-id/cell-id.html#
|
|
2781
|
-
*/
|
|
2782
|
-
function ensureAllNewCellsHaveCellIds(context) {
|
|
2783
|
-
vscode_1.workspace.onDidChangeNotebookDocument(onDidChangeNotebookCells, undefined, context.subscriptions);
|
|
2784
|
-
}
|
|
2785
|
-
exports.ensureAllNewCellsHaveCellIds = ensureAllNewCellsHaveCellIds;
|
|
2786
|
-
function onDidChangeNotebookCells(e) {
|
|
2787
|
-
const nbMetadata = (0, notebookSerializer_1.getNotebookMetadata)(e.notebook);
|
|
2788
|
-
if (!isCellIdRequired(nbMetadata)) {
|
|
2789
|
-
return;
|
|
2790
|
-
}
|
|
2791
|
-
e.contentChanges.forEach(change => {
|
|
2792
|
-
change.addedCells.forEach(cell => {
|
|
2793
|
-
const cellMetadata = (0, serializers_1.getCellMetadata)(cell);
|
|
2794
|
-
if (cellMetadata?.id) {
|
|
2795
|
-
return;
|
|
2796
|
-
}
|
|
2797
|
-
const id = generateCellId(e.notebook);
|
|
2798
|
-
const edit = new vscode_1.WorkspaceEdit();
|
|
2799
|
-
// Don't edit the metadata directly, always get a clone (prevents accidental singletons and directly editing the objects).
|
|
2800
|
-
const updatedMetadata = { ...JSON.parse(JSON.stringify(cellMetadata || {})) };
|
|
2801
|
-
updatedMetadata.id = id;
|
|
2802
|
-
edit.set(cell.notebook.uri, [vscode_1.NotebookEdit.updateCellMetadata(cell.index, { ...(cell.metadata), custom: updatedMetadata })]);
|
|
2803
|
-
vscode_1.workspace.applyEdit(edit);
|
|
2804
|
-
});
|
|
2805
|
-
});
|
|
2806
|
-
}
|
|
2807
|
-
/**
|
|
2808
|
-
* Cell ids are required in notebooks only in notebooks with nbformat >= 4.5
|
|
2809
|
-
*/
|
|
2810
|
-
function isCellIdRequired(metadata) {
|
|
2811
|
-
if ((metadata.nbformat || 0) >= 5) {
|
|
2812
|
-
return true;
|
|
2813
|
-
}
|
|
2814
|
-
if ((metadata.nbformat || 0) === 4 && (metadata.nbformat_minor || 0) >= 5) {
|
|
2815
|
-
return true;
|
|
2816
|
-
}
|
|
2817
|
-
return false;
|
|
2818
|
-
}
|
|
2819
|
-
function generateCellId(notebook) {
|
|
2820
|
-
while (true) {
|
|
2821
|
-
// Details of the id can be found here https://jupyter.org/enhancement-proposals/62-cell-id/cell-id.html#adding-an-id-field,
|
|
2822
|
-
// & here https://jupyter.org/enhancement-proposals/62-cell-id/cell-id.html#updating-older-formats
|
|
2823
|
-
const id = generateUuid().replace(/-/g, '').substring(0, 8);
|
|
2824
|
-
let duplicate = false;
|
|
2825
|
-
for (let index = 0; index < notebook.cellCount; index++) {
|
|
2826
|
-
const cell = notebook.cellAt(index);
|
|
2827
|
-
const existingId = (0, serializers_1.getCellMetadata)(cell)?.id;
|
|
2828
|
-
if (!existingId) {
|
|
2829
|
-
continue;
|
|
2830
|
-
}
|
|
2831
|
-
if (existingId === id) {
|
|
2832
|
-
duplicate = true;
|
|
2833
|
-
break;
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
if (!duplicate) {
|
|
2837
|
-
return id;
|
|
2838
|
-
}
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
/**
|
|
2842
|
-
* Copied from src/vs/base/common/uuid.ts
|
|
2843
|
-
*/
|
|
2844
|
-
function generateUuid() {
|
|
2845
|
-
// use `randomValues` if possible
|
|
2846
|
-
function getRandomValues(bucket) {
|
|
2847
|
-
for (let i = 0; i < bucket.length; i++) {
|
|
2848
|
-
bucket[i] = Math.floor(Math.random() * 256);
|
|
2849
|
-
}
|
|
2850
|
-
return bucket;
|
|
2851
|
-
}
|
|
2852
|
-
// prep-work
|
|
2853
|
-
const _data = new Uint8Array(16);
|
|
2854
|
-
const _hex = [];
|
|
2855
|
-
for (let i = 0; i < 256; i++) {
|
|
2856
|
-
_hex.push(i.toString(16).padStart(2, '0'));
|
|
2857
|
-
}
|
|
2858
|
-
// get data
|
|
2859
|
-
getRandomValues(_data);
|
|
2860
|
-
// set version bits
|
|
2861
|
-
_data[6] = (_data[6] & 0x0f) | 0x40;
|
|
2862
|
-
_data[8] = (_data[8] & 0x3f) | 0x80;
|
|
2863
|
-
// print as string
|
|
2864
|
-
let i = 0;
|
|
2865
|
-
let result = '';
|
|
2866
|
-
result += _hex[_data[i++]];
|
|
2867
|
-
result += _hex[_data[i++]];
|
|
2868
|
-
result += _hex[_data[i++]];
|
|
2869
|
-
result += _hex[_data[i++]];
|
|
2870
|
-
result += '-';
|
|
2871
|
-
result += _hex[_data[i++]];
|
|
2872
|
-
result += _hex[_data[i++]];
|
|
2873
|
-
result += '-';
|
|
2874
|
-
result += _hex[_data[i++]];
|
|
2875
|
-
result += _hex[_data[i++]];
|
|
2876
|
-
result += '-';
|
|
2877
|
-
result += _hex[_data[i++]];
|
|
2878
|
-
result += _hex[_data[i++]];
|
|
2879
|
-
result += '-';
|
|
2880
|
-
result += _hex[_data[i++]];
|
|
2881
|
-
result += _hex[_data[i++]];
|
|
2882
|
-
result += _hex[_data[i++]];
|
|
2883
|
-
result += _hex[_data[i++]];
|
|
2884
|
-
result += _hex[_data[i++]];
|
|
2885
|
-
result += _hex[_data[i++]];
|
|
2886
|
-
return result;
|
|
2887
|
-
}
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
/***/ }),
|
|
2891
|
-
/* 9 */
|
|
2892
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2893
|
-
|
|
2894
|
-
"use strict";
|
|
2895
|
-
|
|
2896
|
-
/*---------------------------------------------------------------------------------------------
|
|
2897
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2898
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
2899
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2900
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2901
|
-
exports.notebookImagePasteSetup = void 0;
|
|
2902
|
-
const vscode = __webpack_require__(1);
|
|
2903
|
-
const constants_1 = __webpack_require__(4);
|
|
2904
|
-
const path_1 = __webpack_require__(10);
|
|
2905
|
-
var MimeType;
|
|
2906
|
-
(function (MimeType) {
|
|
2907
|
-
MimeType["bmp"] = "image/bmp";
|
|
2908
|
-
MimeType["gif"] = "image/gif";
|
|
2909
|
-
MimeType["ico"] = "image/ico";
|
|
2910
|
-
MimeType["jpeg"] = "image/jpeg";
|
|
2911
|
-
MimeType["png"] = "image/png";
|
|
2912
|
-
MimeType["tiff"] = "image/tiff";
|
|
2913
|
-
MimeType["webp"] = "image/webp";
|
|
2914
|
-
MimeType["plain"] = "text/plain";
|
|
2915
|
-
MimeType["uriList"] = "text/uri-list";
|
|
2916
|
-
})(MimeType || (MimeType = {}));
|
|
2917
|
-
const imageMimeTypes = new Set([
|
|
2918
|
-
MimeType.bmp,
|
|
2919
|
-
MimeType.gif,
|
|
2920
|
-
MimeType.ico,
|
|
2921
|
-
MimeType.jpeg,
|
|
2922
|
-
MimeType.png,
|
|
2923
|
-
MimeType.tiff,
|
|
2924
|
-
MimeType.webp,
|
|
2925
|
-
]);
|
|
2926
|
-
const imageExtToMime = new Map([
|
|
2927
|
-
['.bmp', MimeType.bmp],
|
|
2928
|
-
['.gif', MimeType.gif],
|
|
2929
|
-
['.ico', MimeType.ico],
|
|
2930
|
-
['.jpe', MimeType.jpeg],
|
|
2931
|
-
['.jpeg', MimeType.jpeg],
|
|
2932
|
-
['.jpg', MimeType.jpeg],
|
|
2933
|
-
['.png', MimeType.png],
|
|
2934
|
-
['.tif', MimeType.tiff],
|
|
2935
|
-
['.tiff', MimeType.tiff],
|
|
2936
|
-
['.webp', MimeType.webp],
|
|
2937
|
-
]);
|
|
2938
|
-
function getImageMimeType(uri) {
|
|
2939
|
-
return imageExtToMime.get((0, path_1.extname)(uri.fsPath).toLowerCase());
|
|
2940
|
-
}
|
|
2941
|
-
class DropOrPasteEditProvider {
|
|
2942
|
-
constructor() {
|
|
2943
|
-
this.id = 'insertAttachment';
|
|
2944
|
-
}
|
|
2945
|
-
async provideDocumentPasteEdits(document, _ranges, dataTransfer, token) {
|
|
2946
|
-
const enabled = vscode.workspace.getConfiguration('ipynb', document).get('pasteImagesAsAttachments.enabled', true);
|
|
2947
|
-
if (!enabled) {
|
|
2948
|
-
return;
|
|
2949
|
-
}
|
|
2950
|
-
const insert = await this.createInsertImageAttachmentEdit(document, dataTransfer, token);
|
|
2951
|
-
if (!insert) {
|
|
2952
|
-
return;
|
|
2953
|
-
}
|
|
2954
|
-
const pasteEdit = new vscode.DocumentPasteEdit(insert.insertText, vscode.l10n.t('Insert Image as Attachment'));
|
|
2955
|
-
pasteEdit.yieldTo = [{ mimeType: MimeType.plain }];
|
|
2956
|
-
pasteEdit.additionalEdit = insert.additionalEdit;
|
|
2957
|
-
return pasteEdit;
|
|
2958
|
-
}
|
|
2959
|
-
async provideDocumentDropEdits(document, _position, dataTransfer, token) {
|
|
2960
|
-
const insert = await this.createInsertImageAttachmentEdit(document, dataTransfer, token);
|
|
2961
|
-
if (!insert) {
|
|
2962
|
-
return;
|
|
2963
|
-
}
|
|
2964
|
-
const dropEdit = new vscode.DocumentDropEdit(insert.insertText);
|
|
2965
|
-
dropEdit.yieldTo = [{ mimeType: MimeType.plain }];
|
|
2966
|
-
dropEdit.additionalEdit = insert.additionalEdit;
|
|
2967
|
-
dropEdit.label = vscode.l10n.t('Insert Image as Attachment');
|
|
2968
|
-
return dropEdit;
|
|
2969
|
-
}
|
|
2970
|
-
async createInsertImageAttachmentEdit(document, dataTransfer, token) {
|
|
2971
|
-
const imageData = await getDroppedImageData(dataTransfer, token);
|
|
2972
|
-
if (!imageData.length || token.isCancellationRequested) {
|
|
2973
|
-
return;
|
|
2974
|
-
}
|
|
2975
|
-
const currentCell = getCellFromCellDocument(document);
|
|
2976
|
-
if (!currentCell) {
|
|
2977
|
-
return undefined;
|
|
2978
|
-
}
|
|
2979
|
-
// create updated metadata for cell (prep for WorkspaceEdit)
|
|
2980
|
-
const newAttachment = buildAttachment(currentCell, imageData);
|
|
2981
|
-
if (!newAttachment) {
|
|
2982
|
-
return;
|
|
2983
|
-
}
|
|
2984
|
-
// build edits
|
|
2985
|
-
const additionalEdit = new vscode.WorkspaceEdit();
|
|
2986
|
-
const nbEdit = vscode.NotebookEdit.updateCellMetadata(currentCell.index, newAttachment.metadata);
|
|
2987
|
-
const notebookUri = currentCell.notebook.uri;
|
|
2988
|
-
additionalEdit.set(notebookUri, [nbEdit]);
|
|
2989
|
-
// create a snippet for paste
|
|
2990
|
-
const insertText = new vscode.SnippetString();
|
|
2991
|
-
newAttachment.filenames.forEach((filename, i) => {
|
|
2992
|
-
insertText.appendText(' ? `<attachment:${filename}>` : `attachment:${filename}`})`);
|
|
2995
|
-
if (i !== newAttachment.filenames.length - 1) {
|
|
2996
|
-
insertText.appendText(' ');
|
|
2997
|
-
}
|
|
2998
|
-
});
|
|
2999
|
-
return { insertText, additionalEdit };
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
async function getDroppedImageData(dataTransfer, token) {
|
|
3003
|
-
// Prefer using image data in the clipboard
|
|
3004
|
-
const files = coalesce(await Promise.all(Array.from(dataTransfer, async ([mimeType, item]) => {
|
|
3005
|
-
if (!imageMimeTypes.has(mimeType)) {
|
|
3006
|
-
return;
|
|
3007
|
-
}
|
|
3008
|
-
const file = item.asFile();
|
|
3009
|
-
if (!file) {
|
|
3010
|
-
return;
|
|
3011
|
-
}
|
|
3012
|
-
const data = await file.data();
|
|
3013
|
-
return { fileName: file.name, mimeType, data };
|
|
3014
|
-
})));
|
|
3015
|
-
if (files.length) {
|
|
3016
|
-
return files;
|
|
3017
|
-
}
|
|
3018
|
-
// Then fallback to image files in the uri-list
|
|
3019
|
-
const urlList = await dataTransfer.get('text/uri-list')?.asString();
|
|
3020
|
-
if (token.isCancellationRequested) {
|
|
3021
|
-
return [];
|
|
3022
|
-
}
|
|
3023
|
-
if (urlList) {
|
|
3024
|
-
const uris = [];
|
|
3025
|
-
for (const resource of urlList.split(/\r?\n/g)) {
|
|
3026
|
-
try {
|
|
3027
|
-
uris.push(vscode.Uri.parse(resource));
|
|
3028
|
-
}
|
|
3029
|
-
catch {
|
|
3030
|
-
// noop
|
|
3031
|
-
}
|
|
3032
|
-
}
|
|
3033
|
-
const entries = await Promise.all(uris.map(async (uri) => {
|
|
3034
|
-
const mimeType = getImageMimeType(uri);
|
|
3035
|
-
if (!mimeType) {
|
|
3036
|
-
return;
|
|
3037
|
-
}
|
|
3038
|
-
const data = await vscode.workspace.fs.readFile(uri);
|
|
3039
|
-
return { fileName: (0, path_1.basename)(uri.fsPath), mimeType, data };
|
|
3040
|
-
}));
|
|
3041
|
-
return coalesce(entries);
|
|
3042
|
-
}
|
|
3043
|
-
return [];
|
|
3044
|
-
}
|
|
3045
|
-
function coalesce(array) {
|
|
3046
|
-
return array.filter(e => !!e);
|
|
3047
|
-
}
|
|
3048
|
-
function getCellFromCellDocument(cellDocument) {
|
|
3049
|
-
for (const notebook of vscode.workspace.notebookDocuments) {
|
|
3050
|
-
if (notebook.uri.path === cellDocument.uri.path) {
|
|
3051
|
-
for (const cell of notebook.getCells()) {
|
|
3052
|
-
if (cell.document === cellDocument) {
|
|
3053
|
-
return cell;
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3057
|
-
}
|
|
3058
|
-
return undefined;
|
|
3059
|
-
}
|
|
3060
|
-
/**
|
|
3061
|
-
* Taken from https://github.com/microsoft/vscode/blob/743b016722db90df977feecde0a4b3b4f58c2a4c/src/vs/base/common/buffer.ts#L350-L387
|
|
3062
|
-
*/
|
|
3063
|
-
function encodeBase64(buffer, padded = true, urlSafe = false) {
|
|
3064
|
-
const base64Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
3065
|
-
const base64UrlSafeAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
|
|
3066
|
-
const dictionary = urlSafe ? base64UrlSafeAlphabet : base64Alphabet;
|
|
3067
|
-
let output = '';
|
|
3068
|
-
const remainder = buffer.byteLength % 3;
|
|
3069
|
-
let i = 0;
|
|
3070
|
-
for (; i < buffer.byteLength - remainder; i += 3) {
|
|
3071
|
-
const a = buffer[i + 0];
|
|
3072
|
-
const b = buffer[i + 1];
|
|
3073
|
-
const c = buffer[i + 2];
|
|
3074
|
-
output += dictionary[a >>> 2];
|
|
3075
|
-
output += dictionary[(a << 4 | b >>> 4) & 0b111111];
|
|
3076
|
-
output += dictionary[(b << 2 | c >>> 6) & 0b111111];
|
|
3077
|
-
output += dictionary[c & 0b111111];
|
|
3078
|
-
}
|
|
3079
|
-
if (remainder === 1) {
|
|
3080
|
-
const a = buffer[i + 0];
|
|
3081
|
-
output += dictionary[a >>> 2];
|
|
3082
|
-
output += dictionary[(a << 4) & 0b111111];
|
|
3083
|
-
if (padded) {
|
|
3084
|
-
output += '==';
|
|
3085
|
-
}
|
|
3086
|
-
}
|
|
3087
|
-
else if (remainder === 2) {
|
|
3088
|
-
const a = buffer[i + 0];
|
|
3089
|
-
const b = buffer[i + 1];
|
|
3090
|
-
output += dictionary[a >>> 2];
|
|
3091
|
-
output += dictionary[(a << 4 | b >>> 4) & 0b111111];
|
|
3092
|
-
output += dictionary[(b << 2) & 0b111111];
|
|
3093
|
-
if (padded) {
|
|
3094
|
-
output += '=';
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
return output;
|
|
3098
|
-
}
|
|
3099
|
-
function buildAttachment(cell, attachments) {
|
|
3100
|
-
const cellMetadata = { ...cell.metadata };
|
|
3101
|
-
const tempFilenames = [];
|
|
3102
|
-
if (!attachments.length) {
|
|
3103
|
-
return undefined;
|
|
3104
|
-
}
|
|
3105
|
-
if (!cellMetadata.attachments) {
|
|
3106
|
-
cellMetadata.attachments = {};
|
|
3107
|
-
}
|
|
3108
|
-
for (const attachment of attachments) {
|
|
3109
|
-
const b64 = encodeBase64(attachment.data);
|
|
3110
|
-
const fileExt = (0, path_1.extname)(attachment.fileName);
|
|
3111
|
-
const filenameWithoutExt = (0, path_1.basename)(attachment.fileName, fileExt);
|
|
3112
|
-
let tempFilename = filenameWithoutExt + fileExt;
|
|
3113
|
-
for (let appendValue = 2; tempFilename in cellMetadata.attachments; appendValue++) {
|
|
3114
|
-
const objEntries = Object.entries(cellMetadata.attachments[tempFilename]);
|
|
3115
|
-
if (objEntries.length) { // check that mime:b64 are present
|
|
3116
|
-
const [mime, attachmentb64] = objEntries[0];
|
|
3117
|
-
if (mime === attachment.mimeType && attachmentb64 === b64) { // checking if filename can be reused, based on comparison of image data
|
|
3118
|
-
break;
|
|
3119
|
-
}
|
|
3120
|
-
else {
|
|
3121
|
-
tempFilename = filenameWithoutExt.concat(`-${appendValue}`) + fileExt;
|
|
3122
|
-
}
|
|
3123
|
-
}
|
|
3124
|
-
}
|
|
3125
|
-
tempFilenames.push(tempFilename);
|
|
3126
|
-
cellMetadata.attachments[tempFilename] = { [attachment.mimeType]: b64 };
|
|
3127
|
-
}
|
|
3128
|
-
return {
|
|
3129
|
-
metadata: cellMetadata,
|
|
3130
|
-
filenames: tempFilenames,
|
|
3131
|
-
};
|
|
3132
|
-
}
|
|
3133
|
-
function notebookImagePasteSetup() {
|
|
3134
|
-
const provider = new DropOrPasteEditProvider();
|
|
3135
|
-
return vscode.Disposable.from(vscode.languages.registerDocumentPasteEditProvider(constants_1.JUPYTER_NOTEBOOK_MARKDOWN_SELECTOR, provider, {
|
|
3136
|
-
id: provider.id,
|
|
3137
|
-
pasteMimeTypes: [
|
|
3138
|
-
MimeType.png,
|
|
3139
|
-
MimeType.uriList,
|
|
3140
|
-
],
|
|
3141
|
-
}), vscode.languages.registerDocumentDropEditProvider(constants_1.JUPYTER_NOTEBOOK_MARKDOWN_SELECTOR, provider, {
|
|
3142
|
-
id: provider.id,
|
|
3143
|
-
dropMimeTypes: [
|
|
3144
|
-
...Object.values(imageExtToMime),
|
|
3145
|
-
MimeType.uriList,
|
|
3146
|
-
],
|
|
3147
|
-
}));
|
|
3148
|
-
}
|
|
3149
|
-
exports.notebookImagePasteSetup = notebookImagePasteSetup;
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
/***/ }),
|
|
3153
|
-
/* 10 */
|
|
3154
|
-
/***/ ((module) => {
|
|
3155
|
-
|
|
3156
|
-
"use strict";
|
|
3157
|
-
// 'path' module extracted from Node.js v8.11.1 (only the posix part)
|
|
3158
|
-
// transplited with Babel
|
|
3159
|
-
|
|
3160
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
3161
|
-
//
|
|
3162
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
3163
|
-
// copy of this software and associated documentation files (the
|
|
3164
|
-
// "Software"), to deal in the Software without restriction, including
|
|
3165
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
3166
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
3167
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
3168
|
-
// following conditions:
|
|
3169
|
-
//
|
|
3170
|
-
// The above copyright notice and this permission notice shall be included
|
|
3171
|
-
// in all copies or substantial portions of the Software.
|
|
3172
|
-
//
|
|
3173
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
3174
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
3175
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
3176
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
3177
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
3178
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
3179
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
function assertPath(path) {
|
|
3184
|
-
if (typeof path !== 'string') {
|
|
3185
|
-
throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
|
|
3186
|
-
}
|
|
3187
|
-
}
|
|
3188
|
-
|
|
3189
|
-
// Resolves . and .. elements in a path with directory names
|
|
3190
|
-
function normalizeStringPosix(path, allowAboveRoot) {
|
|
3191
|
-
var res = '';
|
|
3192
|
-
var lastSegmentLength = 0;
|
|
3193
|
-
var lastSlash = -1;
|
|
3194
|
-
var dots = 0;
|
|
3195
|
-
var code;
|
|
3196
|
-
for (var i = 0; i <= path.length; ++i) {
|
|
3197
|
-
if (i < path.length)
|
|
3198
|
-
code = path.charCodeAt(i);
|
|
3199
|
-
else if (code === 47 /*/*/)
|
|
3200
|
-
break;
|
|
3201
|
-
else
|
|
3202
|
-
code = 47 /*/*/;
|
|
3203
|
-
if (code === 47 /*/*/) {
|
|
3204
|
-
if (lastSlash === i - 1 || dots === 1) {
|
|
3205
|
-
// NOOP
|
|
3206
|
-
} else if (lastSlash !== i - 1 && dots === 2) {
|
|
3207
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
|
|
3208
|
-
if (res.length > 2) {
|
|
3209
|
-
var lastSlashIndex = res.lastIndexOf('/');
|
|
3210
|
-
if (lastSlashIndex !== res.length - 1) {
|
|
3211
|
-
if (lastSlashIndex === -1) {
|
|
3212
|
-
res = '';
|
|
3213
|
-
lastSegmentLength = 0;
|
|
3214
|
-
} else {
|
|
3215
|
-
res = res.slice(0, lastSlashIndex);
|
|
3216
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
|
|
3217
|
-
}
|
|
3218
|
-
lastSlash = i;
|
|
3219
|
-
dots = 0;
|
|
3220
|
-
continue;
|
|
3221
|
-
}
|
|
3222
|
-
} else if (res.length === 2 || res.length === 1) {
|
|
3223
|
-
res = '';
|
|
3224
|
-
lastSegmentLength = 0;
|
|
3225
|
-
lastSlash = i;
|
|
3226
|
-
dots = 0;
|
|
3227
|
-
continue;
|
|
3228
|
-
}
|
|
3229
|
-
}
|
|
3230
|
-
if (allowAboveRoot) {
|
|
3231
|
-
if (res.length > 0)
|
|
3232
|
-
res += '/..';
|
|
3233
|
-
else
|
|
3234
|
-
res = '..';
|
|
3235
|
-
lastSegmentLength = 2;
|
|
3236
|
-
}
|
|
3237
|
-
} else {
|
|
3238
|
-
if (res.length > 0)
|
|
3239
|
-
res += '/' + path.slice(lastSlash + 1, i);
|
|
3240
|
-
else
|
|
3241
|
-
res = path.slice(lastSlash + 1, i);
|
|
3242
|
-
lastSegmentLength = i - lastSlash - 1;
|
|
3243
|
-
}
|
|
3244
|
-
lastSlash = i;
|
|
3245
|
-
dots = 0;
|
|
3246
|
-
} else if (code === 46 /*.*/ && dots !== -1) {
|
|
3247
|
-
++dots;
|
|
3248
|
-
} else {
|
|
3249
|
-
dots = -1;
|
|
3250
|
-
}
|
|
3251
|
-
}
|
|
3252
|
-
return res;
|
|
3253
|
-
}
|
|
3254
|
-
|
|
3255
|
-
function _format(sep, pathObject) {
|
|
3256
|
-
var dir = pathObject.dir || pathObject.root;
|
|
3257
|
-
var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
|
|
3258
|
-
if (!dir) {
|
|
3259
|
-
return base;
|
|
3260
|
-
}
|
|
3261
|
-
if (dir === pathObject.root) {
|
|
3262
|
-
return dir + base;
|
|
3263
|
-
}
|
|
3264
|
-
return dir + sep + base;
|
|
3265
|
-
}
|
|
3266
|
-
|
|
3267
|
-
var posix = {
|
|
3268
|
-
// path.resolve([from ...], to)
|
|
3269
|
-
resolve: function resolve() {
|
|
3270
|
-
var resolvedPath = '';
|
|
3271
|
-
var resolvedAbsolute = false;
|
|
3272
|
-
var cwd;
|
|
3273
|
-
|
|
3274
|
-
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
3275
|
-
var path;
|
|
3276
|
-
if (i >= 0)
|
|
3277
|
-
path = arguments[i];
|
|
3278
|
-
else {
|
|
3279
|
-
if (cwd === undefined)
|
|
3280
|
-
cwd = process.cwd();
|
|
3281
|
-
path = cwd;
|
|
3282
|
-
}
|
|
3283
|
-
|
|
3284
|
-
assertPath(path);
|
|
3285
|
-
|
|
3286
|
-
// Skip empty entries
|
|
3287
|
-
if (path.length === 0) {
|
|
3288
|
-
continue;
|
|
3289
|
-
}
|
|
3290
|
-
|
|
3291
|
-
resolvedPath = path + '/' + resolvedPath;
|
|
3292
|
-
resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
|
|
3293
|
-
}
|
|
3294
|
-
|
|
3295
|
-
// At this point the path should be resolved to a full absolute path, but
|
|
3296
|
-
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
3297
|
-
|
|
3298
|
-
// Normalize the path
|
|
3299
|
-
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
|
|
3300
|
-
|
|
3301
|
-
if (resolvedAbsolute) {
|
|
3302
|
-
if (resolvedPath.length > 0)
|
|
3303
|
-
return '/' + resolvedPath;
|
|
3304
|
-
else
|
|
3305
|
-
return '/';
|
|
3306
|
-
} else if (resolvedPath.length > 0) {
|
|
3307
|
-
return resolvedPath;
|
|
3308
|
-
} else {
|
|
3309
|
-
return '.';
|
|
3310
|
-
}
|
|
3311
|
-
},
|
|
3312
|
-
|
|
3313
|
-
normalize: function normalize(path) {
|
|
3314
|
-
assertPath(path);
|
|
3315
|
-
|
|
3316
|
-
if (path.length === 0) return '.';
|
|
3317
|
-
|
|
3318
|
-
var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
|
|
3319
|
-
var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
|
|
3320
|
-
|
|
3321
|
-
// Normalize the path
|
|
3322
|
-
path = normalizeStringPosix(path, !isAbsolute);
|
|
3323
|
-
|
|
3324
|
-
if (path.length === 0 && !isAbsolute) path = '.';
|
|
3325
|
-
if (path.length > 0 && trailingSeparator) path += '/';
|
|
3326
|
-
|
|
3327
|
-
if (isAbsolute) return '/' + path;
|
|
3328
|
-
return path;
|
|
3329
|
-
},
|
|
3330
|
-
|
|
3331
|
-
isAbsolute: function isAbsolute(path) {
|
|
3332
|
-
assertPath(path);
|
|
3333
|
-
return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
|
|
3334
|
-
},
|
|
3335
|
-
|
|
3336
|
-
join: function join() {
|
|
3337
|
-
if (arguments.length === 0)
|
|
3338
|
-
return '.';
|
|
3339
|
-
var joined;
|
|
3340
|
-
for (var i = 0; i < arguments.length; ++i) {
|
|
3341
|
-
var arg = arguments[i];
|
|
3342
|
-
assertPath(arg);
|
|
3343
|
-
if (arg.length > 0) {
|
|
3344
|
-
if (joined === undefined)
|
|
3345
|
-
joined = arg;
|
|
3346
|
-
else
|
|
3347
|
-
joined += '/' + arg;
|
|
3348
|
-
}
|
|
3349
|
-
}
|
|
3350
|
-
if (joined === undefined)
|
|
3351
|
-
return '.';
|
|
3352
|
-
return posix.normalize(joined);
|
|
3353
|
-
},
|
|
3354
|
-
|
|
3355
|
-
relative: function relative(from, to) {
|
|
3356
|
-
assertPath(from);
|
|
3357
|
-
assertPath(to);
|
|
3358
|
-
|
|
3359
|
-
if (from === to) return '';
|
|
3360
|
-
|
|
3361
|
-
from = posix.resolve(from);
|
|
3362
|
-
to = posix.resolve(to);
|
|
3363
|
-
|
|
3364
|
-
if (from === to) return '';
|
|
3365
|
-
|
|
3366
|
-
// Trim any leading backslashes
|
|
3367
|
-
var fromStart = 1;
|
|
3368
|
-
for (; fromStart < from.length; ++fromStart) {
|
|
3369
|
-
if (from.charCodeAt(fromStart) !== 47 /*/*/)
|
|
3370
|
-
break;
|
|
3371
|
-
}
|
|
3372
|
-
var fromEnd = from.length;
|
|
3373
|
-
var fromLen = fromEnd - fromStart;
|
|
3374
|
-
|
|
3375
|
-
// Trim any leading backslashes
|
|
3376
|
-
var toStart = 1;
|
|
3377
|
-
for (; toStart < to.length; ++toStart) {
|
|
3378
|
-
if (to.charCodeAt(toStart) !== 47 /*/*/)
|
|
3379
|
-
break;
|
|
3380
|
-
}
|
|
3381
|
-
var toEnd = to.length;
|
|
3382
|
-
var toLen = toEnd - toStart;
|
|
3383
|
-
|
|
3384
|
-
// Compare paths to find the longest common path from root
|
|
3385
|
-
var length = fromLen < toLen ? fromLen : toLen;
|
|
3386
|
-
var lastCommonSep = -1;
|
|
3387
|
-
var i = 0;
|
|
3388
|
-
for (; i <= length; ++i) {
|
|
3389
|
-
if (i === length) {
|
|
3390
|
-
if (toLen > length) {
|
|
3391
|
-
if (to.charCodeAt(toStart + i) === 47 /*/*/) {
|
|
3392
|
-
// We get here if `from` is the exact base path for `to`.
|
|
3393
|
-
// For example: from='/foo/bar'; to='/foo/bar/baz'
|
|
3394
|
-
return to.slice(toStart + i + 1);
|
|
3395
|
-
} else if (i === 0) {
|
|
3396
|
-
// We get here if `from` is the root
|
|
3397
|
-
// For example: from='/'; to='/foo'
|
|
3398
|
-
return to.slice(toStart + i);
|
|
3399
|
-
}
|
|
3400
|
-
} else if (fromLen > length) {
|
|
3401
|
-
if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
|
|
3402
|
-
// We get here if `to` is the exact base path for `from`.
|
|
3403
|
-
// For example: from='/foo/bar/baz'; to='/foo/bar'
|
|
3404
|
-
lastCommonSep = i;
|
|
3405
|
-
} else if (i === 0) {
|
|
3406
|
-
// We get here if `to` is the root.
|
|
3407
|
-
// For example: from='/foo'; to='/'
|
|
3408
|
-
lastCommonSep = 0;
|
|
3409
|
-
}
|
|
3410
|
-
}
|
|
3411
|
-
break;
|
|
3412
|
-
}
|
|
3413
|
-
var fromCode = from.charCodeAt(fromStart + i);
|
|
3414
|
-
var toCode = to.charCodeAt(toStart + i);
|
|
3415
|
-
if (fromCode !== toCode)
|
|
3416
|
-
break;
|
|
3417
|
-
else if (fromCode === 47 /*/*/)
|
|
3418
|
-
lastCommonSep = i;
|
|
3419
|
-
}
|
|
3420
|
-
|
|
3421
|
-
var out = '';
|
|
3422
|
-
// Generate the relative path based on the path difference between `to`
|
|
3423
|
-
// and `from`
|
|
3424
|
-
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
|
|
3425
|
-
if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
|
|
3426
|
-
if (out.length === 0)
|
|
3427
|
-
out += '..';
|
|
3428
|
-
else
|
|
3429
|
-
out += '/..';
|
|
3430
|
-
}
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
|
-
// Lastly, append the rest of the destination (`to`) path that comes after
|
|
3434
|
-
// the common path parts
|
|
3435
|
-
if (out.length > 0)
|
|
3436
|
-
return out + to.slice(toStart + lastCommonSep);
|
|
3437
|
-
else {
|
|
3438
|
-
toStart += lastCommonSep;
|
|
3439
|
-
if (to.charCodeAt(toStart) === 47 /*/*/)
|
|
3440
|
-
++toStart;
|
|
3441
|
-
return to.slice(toStart);
|
|
3442
|
-
}
|
|
3443
|
-
},
|
|
3444
|
-
|
|
3445
|
-
_makeLong: function _makeLong(path) {
|
|
3446
|
-
return path;
|
|
3447
|
-
},
|
|
3448
|
-
|
|
3449
|
-
dirname: function dirname(path) {
|
|
3450
|
-
assertPath(path);
|
|
3451
|
-
if (path.length === 0) return '.';
|
|
3452
|
-
var code = path.charCodeAt(0);
|
|
3453
|
-
var hasRoot = code === 47 /*/*/;
|
|
3454
|
-
var end = -1;
|
|
3455
|
-
var matchedSlash = true;
|
|
3456
|
-
for (var i = path.length - 1; i >= 1; --i) {
|
|
3457
|
-
code = path.charCodeAt(i);
|
|
3458
|
-
if (code === 47 /*/*/) {
|
|
3459
|
-
if (!matchedSlash) {
|
|
3460
|
-
end = i;
|
|
3461
|
-
break;
|
|
3462
|
-
}
|
|
3463
|
-
} else {
|
|
3464
|
-
// We saw the first non-path separator
|
|
3465
|
-
matchedSlash = false;
|
|
3466
|
-
}
|
|
3467
|
-
}
|
|
3468
|
-
|
|
3469
|
-
if (end === -1) return hasRoot ? '/' : '.';
|
|
3470
|
-
if (hasRoot && end === 1) return '//';
|
|
3471
|
-
return path.slice(0, end);
|
|
3472
|
-
},
|
|
3473
|
-
|
|
3474
|
-
basename: function basename(path, ext) {
|
|
3475
|
-
if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
|
|
3476
|
-
assertPath(path);
|
|
3477
|
-
|
|
3478
|
-
var start = 0;
|
|
3479
|
-
var end = -1;
|
|
3480
|
-
var matchedSlash = true;
|
|
3481
|
-
var i;
|
|
3482
|
-
|
|
3483
|
-
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
|
|
3484
|
-
if (ext.length === path.length && ext === path) return '';
|
|
3485
|
-
var extIdx = ext.length - 1;
|
|
3486
|
-
var firstNonSlashEnd = -1;
|
|
3487
|
-
for (i = path.length - 1; i >= 0; --i) {
|
|
3488
|
-
var code = path.charCodeAt(i);
|
|
3489
|
-
if (code === 47 /*/*/) {
|
|
3490
|
-
// If we reached a path separator that was not part of a set of path
|
|
3491
|
-
// separators at the end of the string, stop now
|
|
3492
|
-
if (!matchedSlash) {
|
|
3493
|
-
start = i + 1;
|
|
3494
|
-
break;
|
|
3495
|
-
}
|
|
3496
|
-
} else {
|
|
3497
|
-
if (firstNonSlashEnd === -1) {
|
|
3498
|
-
// We saw the first non-path separator, remember this index in case
|
|
3499
|
-
// we need it if the extension ends up not matching
|
|
3500
|
-
matchedSlash = false;
|
|
3501
|
-
firstNonSlashEnd = i + 1;
|
|
3502
|
-
}
|
|
3503
|
-
if (extIdx >= 0) {
|
|
3504
|
-
// Try to match the explicit extension
|
|
3505
|
-
if (code === ext.charCodeAt(extIdx)) {
|
|
3506
|
-
if (--extIdx === -1) {
|
|
3507
|
-
// We matched the extension, so mark this as the end of our path
|
|
3508
|
-
// component
|
|
3509
|
-
end = i;
|
|
3510
|
-
}
|
|
3511
|
-
} else {
|
|
3512
|
-
// Extension does not match, so our result is the entire path
|
|
3513
|
-
// component
|
|
3514
|
-
extIdx = -1;
|
|
3515
|
-
end = firstNonSlashEnd;
|
|
3516
|
-
}
|
|
3517
|
-
}
|
|
3518
|
-
}
|
|
3519
|
-
}
|
|
3520
|
-
|
|
3521
|
-
if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
|
|
3522
|
-
return path.slice(start, end);
|
|
3523
|
-
} else {
|
|
3524
|
-
for (i = path.length - 1; i >= 0; --i) {
|
|
3525
|
-
if (path.charCodeAt(i) === 47 /*/*/) {
|
|
3526
|
-
// If we reached a path separator that was not part of a set of path
|
|
3527
|
-
// separators at the end of the string, stop now
|
|
3528
|
-
if (!matchedSlash) {
|
|
3529
|
-
start = i + 1;
|
|
3530
|
-
break;
|
|
3531
|
-
}
|
|
3532
|
-
} else if (end === -1) {
|
|
3533
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
3534
|
-
// path component
|
|
3535
|
-
matchedSlash = false;
|
|
3536
|
-
end = i + 1;
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3539
|
-
|
|
3540
|
-
if (end === -1) return '';
|
|
3541
|
-
return path.slice(start, end);
|
|
3542
|
-
}
|
|
3543
|
-
},
|
|
3544
|
-
|
|
3545
|
-
extname: function extname(path) {
|
|
3546
|
-
assertPath(path);
|
|
3547
|
-
var startDot = -1;
|
|
3548
|
-
var startPart = 0;
|
|
3549
|
-
var end = -1;
|
|
3550
|
-
var matchedSlash = true;
|
|
3551
|
-
// Track the state of characters (if any) we see before our first dot and
|
|
3552
|
-
// after any path separator we find
|
|
3553
|
-
var preDotState = 0;
|
|
3554
|
-
for (var i = path.length - 1; i >= 0; --i) {
|
|
3555
|
-
var code = path.charCodeAt(i);
|
|
3556
|
-
if (code === 47 /*/*/) {
|
|
3557
|
-
// If we reached a path separator that was not part of a set of path
|
|
3558
|
-
// separators at the end of the string, stop now
|
|
3559
|
-
if (!matchedSlash) {
|
|
3560
|
-
startPart = i + 1;
|
|
3561
|
-
break;
|
|
3562
|
-
}
|
|
3563
|
-
continue;
|
|
3564
|
-
}
|
|
3565
|
-
if (end === -1) {
|
|
3566
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
3567
|
-
// extension
|
|
3568
|
-
matchedSlash = false;
|
|
3569
|
-
end = i + 1;
|
|
3570
|
-
}
|
|
3571
|
-
if (code === 46 /*.*/) {
|
|
3572
|
-
// If this is our first dot, mark it as the start of our extension
|
|
3573
|
-
if (startDot === -1)
|
|
3574
|
-
startDot = i;
|
|
3575
|
-
else if (preDotState !== 1)
|
|
3576
|
-
preDotState = 1;
|
|
3577
|
-
} else if (startDot !== -1) {
|
|
3578
|
-
// We saw a non-dot and non-path separator before our dot, so we should
|
|
3579
|
-
// have a good chance at having a non-empty extension
|
|
3580
|
-
preDotState = -1;
|
|
3581
|
-
}
|
|
3582
|
-
}
|
|
3583
|
-
|
|
3584
|
-
if (startDot === -1 || end === -1 ||
|
|
3585
|
-
// We saw a non-dot character immediately before the dot
|
|
3586
|
-
preDotState === 0 ||
|
|
3587
|
-
// The (right-most) trimmed path component is exactly '..'
|
|
3588
|
-
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
3589
|
-
return '';
|
|
3590
|
-
}
|
|
3591
|
-
return path.slice(startDot, end);
|
|
3592
|
-
},
|
|
3593
|
-
|
|
3594
|
-
format: function format(pathObject) {
|
|
3595
|
-
if (pathObject === null || typeof pathObject !== 'object') {
|
|
3596
|
-
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
|
|
3597
|
-
}
|
|
3598
|
-
return _format('/', pathObject);
|
|
3599
|
-
},
|
|
3600
|
-
|
|
3601
|
-
parse: function parse(path) {
|
|
3602
|
-
assertPath(path);
|
|
3603
|
-
|
|
3604
|
-
var ret = { root: '', dir: '', base: '', ext: '', name: '' };
|
|
3605
|
-
if (path.length === 0) return ret;
|
|
3606
|
-
var code = path.charCodeAt(0);
|
|
3607
|
-
var isAbsolute = code === 47 /*/*/;
|
|
3608
|
-
var start;
|
|
3609
|
-
if (isAbsolute) {
|
|
3610
|
-
ret.root = '/';
|
|
3611
|
-
start = 1;
|
|
3612
|
-
} else {
|
|
3613
|
-
start = 0;
|
|
3614
|
-
}
|
|
3615
|
-
var startDot = -1;
|
|
3616
|
-
var startPart = 0;
|
|
3617
|
-
var end = -1;
|
|
3618
|
-
var matchedSlash = true;
|
|
3619
|
-
var i = path.length - 1;
|
|
3620
|
-
|
|
3621
|
-
// Track the state of characters (if any) we see before our first dot and
|
|
3622
|
-
// after any path separator we find
|
|
3623
|
-
var preDotState = 0;
|
|
3624
|
-
|
|
3625
|
-
// Get non-dir info
|
|
3626
|
-
for (; i >= start; --i) {
|
|
3627
|
-
code = path.charCodeAt(i);
|
|
3628
|
-
if (code === 47 /*/*/) {
|
|
3629
|
-
// If we reached a path separator that was not part of a set of path
|
|
3630
|
-
// separators at the end of the string, stop now
|
|
3631
|
-
if (!matchedSlash) {
|
|
3632
|
-
startPart = i + 1;
|
|
3633
|
-
break;
|
|
3634
|
-
}
|
|
3635
|
-
continue;
|
|
3636
|
-
}
|
|
3637
|
-
if (end === -1) {
|
|
3638
|
-
// We saw the first non-path separator, mark this as the end of our
|
|
3639
|
-
// extension
|
|
3640
|
-
matchedSlash = false;
|
|
3641
|
-
end = i + 1;
|
|
3642
|
-
}
|
|
3643
|
-
if (code === 46 /*.*/) {
|
|
3644
|
-
// If this is our first dot, mark it as the start of our extension
|
|
3645
|
-
if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
|
|
3646
|
-
} else if (startDot !== -1) {
|
|
3647
|
-
// We saw a non-dot and non-path separator before our dot, so we should
|
|
3648
|
-
// have a good chance at having a non-empty extension
|
|
3649
|
-
preDotState = -1;
|
|
3650
|
-
}
|
|
3651
|
-
}
|
|
3652
|
-
|
|
3653
|
-
if (startDot === -1 || end === -1 ||
|
|
3654
|
-
// We saw a non-dot character immediately before the dot
|
|
3655
|
-
preDotState === 0 ||
|
|
3656
|
-
// The (right-most) trimmed path component is exactly '..'
|
|
3657
|
-
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
3658
|
-
if (end !== -1) {
|
|
3659
|
-
if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
|
|
3660
|
-
}
|
|
3661
|
-
} else {
|
|
3662
|
-
if (startPart === 0 && isAbsolute) {
|
|
3663
|
-
ret.name = path.slice(1, startDot);
|
|
3664
|
-
ret.base = path.slice(1, end);
|
|
3665
|
-
} else {
|
|
3666
|
-
ret.name = path.slice(startPart, startDot);
|
|
3667
|
-
ret.base = path.slice(startPart, end);
|
|
3668
|
-
}
|
|
3669
|
-
ret.ext = path.slice(startDot, end);
|
|
3670
|
-
}
|
|
3671
|
-
|
|
3672
|
-
if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
|
|
3673
|
-
|
|
3674
|
-
return ret;
|
|
3675
|
-
},
|
|
3676
|
-
|
|
3677
|
-
sep: '/',
|
|
3678
|
-
delimiter: ':',
|
|
3679
|
-
win32: null,
|
|
3680
|
-
posix: null
|
|
3681
|
-
};
|
|
3682
|
-
|
|
3683
|
-
posix.posix = posix;
|
|
3684
|
-
|
|
3685
|
-
module.exports = posix;
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
/***/ }),
|
|
3689
|
-
/* 11 */
|
|
3690
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3691
|
-
|
|
3692
|
-
"use strict";
|
|
3693
|
-
|
|
3694
|
-
/*---------------------------------------------------------------------------------------------
|
|
3695
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3696
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
3697
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3698
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3699
|
-
exports.AttachmentCleaner = exports.DiagnosticCode = void 0;
|
|
3700
|
-
const vscode = __webpack_require__(1);
|
|
3701
|
-
const constants_1 = __webpack_require__(4);
|
|
3702
|
-
const helper_1 = __webpack_require__(12);
|
|
3703
|
-
var DiagnosticCode;
|
|
3704
|
-
(function (DiagnosticCode) {
|
|
3705
|
-
DiagnosticCode["missing_attachment"] = "notebook.missing-attachment";
|
|
3706
|
-
})(DiagnosticCode || (exports.DiagnosticCode = DiagnosticCode = {}));
|
|
3707
|
-
class AttachmentCleaner {
|
|
3708
|
-
constructor() {
|
|
3709
|
-
this._attachmentCache = new Map();
|
|
3710
|
-
this._delayer = new helper_1.Delayer(750);
|
|
3711
|
-
this._disposables = [];
|
|
3712
|
-
this._imageDiagnosticCollection = vscode.languages.createDiagnosticCollection('Notebook Image Attachment');
|
|
3713
|
-
this._disposables.push(this._imageDiagnosticCollection);
|
|
3714
|
-
this._disposables.push(vscode.commands.registerCommand(constants_1.ATTACHMENT_CLEANUP_COMMANDID, async (document, range) => {
|
|
3715
|
-
const workspaceEdit = new vscode.WorkspaceEdit();
|
|
3716
|
-
workspaceEdit.delete(document, range);
|
|
3717
|
-
await vscode.workspace.applyEdit(workspaceEdit);
|
|
3718
|
-
}));
|
|
3719
|
-
this._disposables.push(vscode.languages.registerCodeActionsProvider(constants_1.JUPYTER_NOTEBOOK_MARKDOWN_SELECTOR, this, {
|
|
3720
|
-
providedCodeActionKinds: [
|
|
3721
|
-
vscode.CodeActionKind.QuickFix
|
|
3722
|
-
],
|
|
3723
|
-
}));
|
|
3724
|
-
this._disposables.push(vscode.workspace.onDidChangeNotebookDocument(e => {
|
|
3725
|
-
this._delayer.trigger(() => {
|
|
3726
|
-
e.cellChanges.forEach(change => {
|
|
3727
|
-
if (!change.document) {
|
|
3728
|
-
return;
|
|
3729
|
-
}
|
|
3730
|
-
if (change.cell.kind !== vscode.NotebookCellKind.Markup) {
|
|
3731
|
-
return;
|
|
3732
|
-
}
|
|
3733
|
-
const metadataEdit = this.cleanNotebookAttachments({
|
|
3734
|
-
notebook: e.notebook,
|
|
3735
|
-
cell: change.cell,
|
|
3736
|
-
document: change.document
|
|
3737
|
-
});
|
|
3738
|
-
if (metadataEdit) {
|
|
3739
|
-
const workspaceEdit = new vscode.WorkspaceEdit();
|
|
3740
|
-
workspaceEdit.set(e.notebook.uri, [metadataEdit]);
|
|
3741
|
-
vscode.workspace.applyEdit(workspaceEdit);
|
|
3742
|
-
}
|
|
3743
|
-
});
|
|
3744
|
-
});
|
|
3745
|
-
}));
|
|
3746
|
-
this._disposables.push(vscode.workspace.onWillSaveNotebookDocument(e => {
|
|
3747
|
-
if (e.reason === vscode.TextDocumentSaveReason.Manual) {
|
|
3748
|
-
this._delayer.dispose();
|
|
3749
|
-
e.waitUntil(new Promise((resolve) => {
|
|
3750
|
-
if (e.notebook.getCells().length === 0) {
|
|
3751
|
-
return;
|
|
3752
|
-
}
|
|
3753
|
-
const notebookEdits = [];
|
|
3754
|
-
for (const cell of e.notebook.getCells()) {
|
|
3755
|
-
if (cell.kind !== vscode.NotebookCellKind.Markup) {
|
|
3756
|
-
continue;
|
|
3757
|
-
}
|
|
3758
|
-
const metadataEdit = this.cleanNotebookAttachments({
|
|
3759
|
-
notebook: e.notebook,
|
|
3760
|
-
cell: cell,
|
|
3761
|
-
document: cell.document
|
|
3762
|
-
});
|
|
3763
|
-
if (metadataEdit) {
|
|
3764
|
-
notebookEdits.push(metadataEdit);
|
|
3765
|
-
}
|
|
3766
|
-
}
|
|
3767
|
-
const workspaceEdit = new vscode.WorkspaceEdit();
|
|
3768
|
-
workspaceEdit.set(e.notebook.uri, notebookEdits);
|
|
3769
|
-
resolve(workspaceEdit);
|
|
3770
|
-
}));
|
|
3771
|
-
}
|
|
3772
|
-
}));
|
|
3773
|
-
this._disposables.push(vscode.workspace.onDidCloseNotebookDocument(e => {
|
|
3774
|
-
this._attachmentCache.delete(e.uri.toString());
|
|
3775
|
-
}));
|
|
3776
|
-
this._disposables.push(vscode.workspace.onWillRenameFiles(e => {
|
|
3777
|
-
const re = /\.ipynb$/;
|
|
3778
|
-
for (const file of e.files) {
|
|
3779
|
-
if (!re.exec(file.oldUri.toString())) {
|
|
3780
|
-
continue;
|
|
3781
|
-
}
|
|
3782
|
-
// transfer cache to new uri
|
|
3783
|
-
if (this._attachmentCache.has(file.oldUri.toString())) {
|
|
3784
|
-
this._attachmentCache.set(file.newUri.toString(), this._attachmentCache.get(file.oldUri.toString()));
|
|
3785
|
-
this._attachmentCache.delete(file.oldUri.toString());
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
}));
|
|
3789
|
-
this._disposables.push(vscode.workspace.onDidOpenTextDocument(e => {
|
|
3790
|
-
this.analyzeMissingAttachments(e);
|
|
3791
|
-
}));
|
|
3792
|
-
this._disposables.push(vscode.workspace.onDidCloseTextDocument(e => {
|
|
3793
|
-
this.analyzeMissingAttachments(e);
|
|
3794
|
-
}));
|
|
3795
|
-
vscode.workspace.textDocuments.forEach(document => {
|
|
3796
|
-
this.analyzeMissingAttachments(document);
|
|
3797
|
-
});
|
|
3798
|
-
}
|
|
3799
|
-
provideCodeActions(document, _range, context, _token) {
|
|
3800
|
-
const fixes = [];
|
|
3801
|
-
for (const diagnostic of context.diagnostics) {
|
|
3802
|
-
switch (diagnostic.code) {
|
|
3803
|
-
case DiagnosticCode.missing_attachment:
|
|
3804
|
-
{
|
|
3805
|
-
const fix = new vscode.CodeAction('Remove invalid image attachment reference', vscode.CodeActionKind.QuickFix);
|
|
3806
|
-
fix.command = {
|
|
3807
|
-
command: constants_1.ATTACHMENT_CLEANUP_COMMANDID,
|
|
3808
|
-
title: 'Remove invalid image attachment reference',
|
|
3809
|
-
arguments: [document.uri, diagnostic.range],
|
|
3810
|
-
};
|
|
3811
|
-
fixes.push(fix);
|
|
3812
|
-
}
|
|
3813
|
-
break;
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
return fixes;
|
|
3817
|
-
}
|
|
3818
|
-
/**
|
|
3819
|
-
* take in a NotebookDocumentChangeEvent, and clean the attachment data for the cell(s) that have had their markdown source code changed
|
|
3820
|
-
* @param e NotebookDocumentChangeEvent from the onDidChangeNotebookDocument listener
|
|
3821
|
-
* @returns vscode.NotebookEdit, the metadata alteration performed on the json behind the ipynb
|
|
3822
|
-
*/
|
|
3823
|
-
cleanNotebookAttachments(e) {
|
|
3824
|
-
if (e.notebook.isClosed) {
|
|
3825
|
-
return;
|
|
3826
|
-
}
|
|
3827
|
-
const document = e.document;
|
|
3828
|
-
const cell = e.cell;
|
|
3829
|
-
const markdownAttachmentsInUse = {};
|
|
3830
|
-
const cellFragment = cell.document.uri.fragment;
|
|
3831
|
-
const notebookUri = e.notebook.uri.toString();
|
|
3832
|
-
const diagnostics = [];
|
|
3833
|
-
const markdownAttachmentsRefedInCell = this.getAttachmentNames(document);
|
|
3834
|
-
if (markdownAttachmentsRefedInCell.size === 0) {
|
|
3835
|
-
// no attachments used in this cell, cache all images from cell metadata
|
|
3836
|
-
this.saveAllAttachmentsToCache(cell.metadata, notebookUri, cellFragment);
|
|
3837
|
-
}
|
|
3838
|
-
if (this.checkMetadataHasAttachmentsField(cell.metadata)) {
|
|
3839
|
-
// the cell metadata contains attachments, check if any are used in the markdown source
|
|
3840
|
-
for (const [currFilename, attachment] of Object.entries(cell.metadata.attachments)) {
|
|
3841
|
-
// means markdown reference is present in the metadata, rendering will work properly
|
|
3842
|
-
// therefore, we don't need to check it in the next loop either
|
|
3843
|
-
if (markdownAttachmentsRefedInCell.has(currFilename)) {
|
|
3844
|
-
// attachment reference is present in the markdown source, no need to cache it
|
|
3845
|
-
markdownAttachmentsRefedInCell.get(currFilename).valid = true;
|
|
3846
|
-
markdownAttachmentsInUse[currFilename] = attachment;
|
|
3847
|
-
}
|
|
3848
|
-
else {
|
|
3849
|
-
// attachment reference is not present in the markdown source, cache it
|
|
3850
|
-
this.saveAttachmentToCache(notebookUri, cellFragment, currFilename, cell.metadata);
|
|
3851
|
-
}
|
|
3852
|
-
}
|
|
3853
|
-
}
|
|
3854
|
-
for (const [currFilename, attachment] of markdownAttachmentsRefedInCell) {
|
|
3855
|
-
if (attachment.valid) {
|
|
3856
|
-
// attachment reference is present in both the markdown source and the metadata, no op
|
|
3857
|
-
continue;
|
|
3858
|
-
}
|
|
3859
|
-
// if image is referenced in markdown source but not in metadata -> check if we have image in the cache
|
|
3860
|
-
const cachedImageAttachment = this._attachmentCache.get(notebookUri)?.get(cellFragment)?.get(currFilename);
|
|
3861
|
-
if (cachedImageAttachment) {
|
|
3862
|
-
markdownAttachmentsInUse[currFilename] = cachedImageAttachment;
|
|
3863
|
-
this._attachmentCache.get(notebookUri)?.get(cellFragment)?.delete(currFilename);
|
|
3864
|
-
}
|
|
3865
|
-
else {
|
|
3866
|
-
// if image is not in the cache, show warning
|
|
3867
|
-
diagnostics.push({ name: currFilename, ranges: attachment.ranges });
|
|
3868
|
-
}
|
|
3869
|
-
}
|
|
3870
|
-
this.updateDiagnostics(cell.document.uri, diagnostics);
|
|
3871
|
-
if (cell.index > -1 && !(0, helper_1.objectEquals)(markdownAttachmentsInUse, cell.metadata.attachments)) {
|
|
3872
|
-
const updateMetadata = (0, helper_1.deepClone)(cell.metadata);
|
|
3873
|
-
if (Object.keys(markdownAttachmentsInUse).length === 0) {
|
|
3874
|
-
updateMetadata.attachments = undefined;
|
|
3875
|
-
}
|
|
3876
|
-
else {
|
|
3877
|
-
updateMetadata.attachments = markdownAttachmentsInUse;
|
|
3878
|
-
}
|
|
3879
|
-
const metadataEdit = vscode.NotebookEdit.updateCellMetadata(cell.index, updateMetadata);
|
|
3880
|
-
return metadataEdit;
|
|
3881
|
-
}
|
|
3882
|
-
return;
|
|
3883
|
-
}
|
|
3884
|
-
analyzeMissingAttachments(document) {
|
|
3885
|
-
if (document.uri.scheme !== 'vscode-notebook-cell') {
|
|
3886
|
-
// not notebook
|
|
3887
|
-
return;
|
|
3888
|
-
}
|
|
3889
|
-
if (document.isClosed) {
|
|
3890
|
-
this.updateDiagnostics(document.uri, []);
|
|
3891
|
-
return;
|
|
3892
|
-
}
|
|
3893
|
-
let notebook;
|
|
3894
|
-
let activeCell;
|
|
3895
|
-
for (const notebookDocument of vscode.workspace.notebookDocuments) {
|
|
3896
|
-
const cell = notebookDocument.getCells().find(cell => cell.document === document);
|
|
3897
|
-
if (cell) {
|
|
3898
|
-
notebook = notebookDocument;
|
|
3899
|
-
activeCell = cell;
|
|
3900
|
-
break;
|
|
3901
|
-
}
|
|
3902
|
-
}
|
|
3903
|
-
if (!notebook || !activeCell) {
|
|
3904
|
-
return;
|
|
3905
|
-
}
|
|
3906
|
-
const diagnostics = [];
|
|
3907
|
-
const markdownAttachments = this.getAttachmentNames(document);
|
|
3908
|
-
if (this.checkMetadataHasAttachmentsField(activeCell.metadata)) {
|
|
3909
|
-
for (const [currFilename, attachment] of markdownAttachments) {
|
|
3910
|
-
if (!activeCell.metadata.attachments[currFilename]) {
|
|
3911
|
-
// no attachment reference in the metadata
|
|
3912
|
-
diagnostics.push({ name: currFilename, ranges: attachment.ranges });
|
|
3913
|
-
}
|
|
3914
|
-
}
|
|
3915
|
-
}
|
|
3916
|
-
this.updateDiagnostics(activeCell.document.uri, diagnostics);
|
|
3917
|
-
}
|
|
3918
|
-
updateDiagnostics(cellUri, diagnostics) {
|
|
3919
|
-
const vscodeDiagnostics = [];
|
|
3920
|
-
for (const currDiagnostic of diagnostics) {
|
|
3921
|
-
currDiagnostic.ranges.forEach(range => {
|
|
3922
|
-
const diagnostic = new vscode.Diagnostic(range, `The image named: '${currDiagnostic.name}' is not present in cell metadata.`, vscode.DiagnosticSeverity.Warning);
|
|
3923
|
-
diagnostic.code = DiagnosticCode.missing_attachment;
|
|
3924
|
-
vscodeDiagnostics.push(diagnostic);
|
|
3925
|
-
});
|
|
3926
|
-
}
|
|
3927
|
-
this._imageDiagnosticCollection.set(cellUri, vscodeDiagnostics);
|
|
3928
|
-
}
|
|
3929
|
-
/**
|
|
3930
|
-
* remove attachment from metadata and add it to the cache
|
|
3931
|
-
* @param notebookUri uri of the notebook currently being edited
|
|
3932
|
-
* @param cellFragment fragment of the cell currently being edited
|
|
3933
|
-
* @param currFilename filename of the image being pulled into the cell
|
|
3934
|
-
* @param metadata metadata of the cell currently being edited
|
|
3935
|
-
*/
|
|
3936
|
-
saveAttachmentToCache(notebookUri, cellFragment, currFilename, metadata) {
|
|
3937
|
-
const documentCache = this._attachmentCache.get(notebookUri);
|
|
3938
|
-
if (!documentCache) {
|
|
3939
|
-
// no cache for this notebook yet
|
|
3940
|
-
const cellCache = new Map();
|
|
3941
|
-
cellCache.set(currFilename, this.getMetadataAttachment(metadata, currFilename));
|
|
3942
|
-
const documentCache = new Map();
|
|
3943
|
-
documentCache.set(cellFragment, cellCache);
|
|
3944
|
-
this._attachmentCache.set(notebookUri, documentCache);
|
|
3945
|
-
}
|
|
3946
|
-
else if (!documentCache.has(cellFragment)) {
|
|
3947
|
-
// no cache for this cell yet
|
|
3948
|
-
const cellCache = new Map();
|
|
3949
|
-
cellCache.set(currFilename, this.getMetadataAttachment(metadata, currFilename));
|
|
3950
|
-
documentCache.set(cellFragment, cellCache);
|
|
3951
|
-
}
|
|
3952
|
-
else {
|
|
3953
|
-
// cache for this cell already exists
|
|
3954
|
-
// add to cell cache
|
|
3955
|
-
documentCache.get(cellFragment)?.set(currFilename, this.getMetadataAttachment(metadata, currFilename));
|
|
3956
|
-
}
|
|
3957
|
-
}
|
|
3958
|
-
/**
|
|
3959
|
-
* get an attachment entry from the given metadata
|
|
3960
|
-
* @param metadata metadata to extract image data from
|
|
3961
|
-
* @param currFilename filename of image being extracted
|
|
3962
|
-
* @returns
|
|
3963
|
-
*/
|
|
3964
|
-
getMetadataAttachment(metadata, currFilename) {
|
|
3965
|
-
return metadata.attachments[currFilename];
|
|
3966
|
-
}
|
|
3967
|
-
/**
|
|
3968
|
-
* returns a boolean that represents if there are any images in the attachment field of a cell's metadata
|
|
3969
|
-
* @param metadata metadata of cell
|
|
3970
|
-
* @returns boolean representing the presence of any attachments
|
|
3971
|
-
*/
|
|
3972
|
-
checkMetadataHasAttachmentsField(metadata) {
|
|
3973
|
-
return !!metadata.attachments && typeof metadata.attachments === 'object';
|
|
3974
|
-
}
|
|
3975
|
-
/**
|
|
3976
|
-
* given metadata from a cell, cache every image (used in cases with no image links in markdown source)
|
|
3977
|
-
* @param metadata metadata for a cell with no images in markdown source
|
|
3978
|
-
* @param notebookUri uri for the notebook being edited
|
|
3979
|
-
* @param cellFragment fragment of cell being edited
|
|
3980
|
-
*/
|
|
3981
|
-
saveAllAttachmentsToCache(metadata, notebookUri, cellFragment) {
|
|
3982
|
-
const documentCache = this._attachmentCache.get(notebookUri) ?? new Map();
|
|
3983
|
-
this._attachmentCache.set(notebookUri, documentCache);
|
|
3984
|
-
const cellCache = documentCache.get(cellFragment) ?? new Map();
|
|
3985
|
-
documentCache.set(cellFragment, cellCache);
|
|
3986
|
-
if (metadata.attachments && typeof metadata.attachments === 'object') {
|
|
3987
|
-
for (const [currFilename, attachment] of Object.entries(metadata.attachments)) {
|
|
3988
|
-
cellCache.set(currFilename, attachment);
|
|
3989
|
-
}
|
|
3990
|
-
}
|
|
3991
|
-
}
|
|
3992
|
-
/**
|
|
3993
|
-
* pass in all of the markdown source code, and get a dictionary of all images referenced in the markdown. keys are image filenames, values are render state
|
|
3994
|
-
* @param document the text document for the cell, formatted as a string
|
|
3995
|
-
*/
|
|
3996
|
-
getAttachmentNames(document) {
|
|
3997
|
-
const source = document.getText();
|
|
3998
|
-
const filenames = new Map();
|
|
3999
|
-
const re = /!\[.*?\]\(<?attachment:(?<filename>.*?)>?\)/gm;
|
|
4000
|
-
let match;
|
|
4001
|
-
while ((match = re.exec(source))) {
|
|
4002
|
-
if (match.groups?.filename) {
|
|
4003
|
-
const index = match.index;
|
|
4004
|
-
const length = match[0].length;
|
|
4005
|
-
const startPosition = document.positionAt(index);
|
|
4006
|
-
const endPosition = document.positionAt(index + length);
|
|
4007
|
-
const range = new vscode.Range(startPosition, endPosition);
|
|
4008
|
-
const filename = filenames.get(match.groups.filename) ?? { valid: false, ranges: [] };
|
|
4009
|
-
filenames.set(match.groups.filename, filename);
|
|
4010
|
-
filename.ranges.push(range);
|
|
4011
|
-
}
|
|
4012
|
-
}
|
|
4013
|
-
return filenames;
|
|
4014
|
-
}
|
|
4015
|
-
dispose() {
|
|
4016
|
-
this._disposables.forEach(d => d.dispose());
|
|
4017
|
-
this._delayer.dispose();
|
|
4018
|
-
}
|
|
4019
|
-
}
|
|
4020
|
-
exports.AttachmentCleaner = AttachmentCleaner;
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
/***/ }),
|
|
4024
|
-
/* 12 */
|
|
4025
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
4026
|
-
|
|
4027
|
-
"use strict";
|
|
4028
|
-
|
|
4029
|
-
/*---------------------------------------------------------------------------------------------
|
|
4030
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4031
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4032
|
-
*--------------------------------------------------------------------------------------------*/
|
|
4033
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4034
|
-
exports.Delayer = exports.objectEquals = exports.deepClone = void 0;
|
|
4035
|
-
function deepClone(obj) {
|
|
4036
|
-
if (!obj || typeof obj !== 'object') {
|
|
4037
|
-
return obj;
|
|
4038
|
-
}
|
|
4039
|
-
if (obj instanceof RegExp) {
|
|
4040
|
-
// See https://github.com/microsoft/TypeScript/issues/10990
|
|
4041
|
-
return obj;
|
|
4042
|
-
}
|
|
4043
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
4044
|
-
Object.keys(obj).forEach((key) => {
|
|
4045
|
-
if (obj[key] && typeof obj[key] === 'object') {
|
|
4046
|
-
result[key] = deepClone(obj[key]);
|
|
4047
|
-
}
|
|
4048
|
-
else {
|
|
4049
|
-
result[key] = obj[key];
|
|
4050
|
-
}
|
|
4051
|
-
});
|
|
4052
|
-
return result;
|
|
4053
|
-
}
|
|
4054
|
-
exports.deepClone = deepClone;
|
|
4055
|
-
// from https://github.com/microsoft/vscode/blob/43ae27a30e7b5e8711bf6b218ee39872ed2b8ef6/src/vs/base/common/objects.ts#L117
|
|
4056
|
-
function objectEquals(one, other) {
|
|
4057
|
-
if (one === other) {
|
|
4058
|
-
return true;
|
|
4059
|
-
}
|
|
4060
|
-
if (one === null || one === undefined || other === null || other === undefined) {
|
|
4061
|
-
return false;
|
|
4062
|
-
}
|
|
4063
|
-
if (typeof one !== typeof other) {
|
|
4064
|
-
return false;
|
|
4065
|
-
}
|
|
4066
|
-
if (typeof one !== 'object') {
|
|
4067
|
-
return false;
|
|
4068
|
-
}
|
|
4069
|
-
if ((Array.isArray(one)) !== (Array.isArray(other))) {
|
|
4070
|
-
return false;
|
|
4071
|
-
}
|
|
4072
|
-
let i;
|
|
4073
|
-
let key;
|
|
4074
|
-
if (Array.isArray(one)) {
|
|
4075
|
-
if (one.length !== other.length) {
|
|
4076
|
-
return false;
|
|
4077
|
-
}
|
|
4078
|
-
for (i = 0; i < one.length; i++) {
|
|
4079
|
-
if (!objectEquals(one[i], other[i])) {
|
|
4080
|
-
return false;
|
|
4081
|
-
}
|
|
4082
|
-
}
|
|
4083
|
-
}
|
|
4084
|
-
else {
|
|
4085
|
-
const oneKeys = [];
|
|
4086
|
-
for (key in one) {
|
|
4087
|
-
oneKeys.push(key);
|
|
4088
|
-
}
|
|
4089
|
-
oneKeys.sort();
|
|
4090
|
-
const otherKeys = [];
|
|
4091
|
-
for (key in other) {
|
|
4092
|
-
otherKeys.push(key);
|
|
4093
|
-
}
|
|
4094
|
-
otherKeys.sort();
|
|
4095
|
-
if (!objectEquals(oneKeys, otherKeys)) {
|
|
4096
|
-
return false;
|
|
4097
|
-
}
|
|
4098
|
-
for (i = 0; i < oneKeys.length; i++) {
|
|
4099
|
-
if (!objectEquals(one[oneKeys[i]], other[oneKeys[i]])) {
|
|
4100
|
-
return false;
|
|
4101
|
-
}
|
|
4102
|
-
}
|
|
4103
|
-
}
|
|
4104
|
-
return true;
|
|
4105
|
-
}
|
|
4106
|
-
exports.objectEquals = objectEquals;
|
|
4107
|
-
/**
|
|
4108
|
-
* A helper to delay/debounce execution of a task, includes cancellation/disposal support.
|
|
4109
|
-
* Pulled from https://github.com/microsoft/vscode/blob/3059063b805ed0ac10a6d9539e213386bfcfb852/extensions/markdown-language-features/src/util/async.ts
|
|
4110
|
-
*/
|
|
4111
|
-
class Delayer {
|
|
4112
|
-
constructor(defaultDelay) {
|
|
4113
|
-
this.defaultDelay = defaultDelay;
|
|
4114
|
-
this._timeout = null;
|
|
4115
|
-
this._cancelTimeout = null;
|
|
4116
|
-
this._onSuccess = null;
|
|
4117
|
-
this._task = null;
|
|
4118
|
-
}
|
|
4119
|
-
dispose() {
|
|
4120
|
-
this._doCancelTimeout();
|
|
4121
|
-
}
|
|
4122
|
-
trigger(task, delay = this.defaultDelay) {
|
|
4123
|
-
this._task = task;
|
|
4124
|
-
if (delay >= 0) {
|
|
4125
|
-
this._doCancelTimeout();
|
|
4126
|
-
}
|
|
4127
|
-
if (!this._cancelTimeout) {
|
|
4128
|
-
this._cancelTimeout = new Promise((resolve) => {
|
|
4129
|
-
this._onSuccess = resolve;
|
|
4130
|
-
}).then(() => {
|
|
4131
|
-
this._cancelTimeout = null;
|
|
4132
|
-
this._onSuccess = null;
|
|
4133
|
-
const result = this._task && this._task?.();
|
|
4134
|
-
this._task = null;
|
|
4135
|
-
return result;
|
|
4136
|
-
});
|
|
4137
|
-
}
|
|
4138
|
-
if (delay >= 0 || this._timeout === null) {
|
|
4139
|
-
this._timeout = setTimeout(() => {
|
|
4140
|
-
this._timeout = null;
|
|
4141
|
-
this._onSuccess?.(undefined);
|
|
4142
|
-
}, delay >= 0 ? delay : this.defaultDelay);
|
|
4143
|
-
}
|
|
4144
|
-
return this._cancelTimeout;
|
|
4145
|
-
}
|
|
4146
|
-
_doCancelTimeout() {
|
|
4147
|
-
if (this._timeout !== null) {
|
|
4148
|
-
clearTimeout(this._timeout);
|
|
4149
|
-
this._timeout = null;
|
|
4150
|
-
}
|
|
4151
|
-
}
|
|
4152
|
-
}
|
|
4153
|
-
exports.Delayer = Delayer;
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
/***/ })
|
|
4157
|
-
/******/ ]);
|
|
4158
|
-
/************************************************************************/
|
|
4159
|
-
/******/ // The module cache
|
|
4160
|
-
/******/ var __webpack_module_cache__ = {};
|
|
4161
|
-
/******/
|
|
4162
|
-
/******/ // The require function
|
|
4163
|
-
/******/ function __webpack_require__(moduleId) {
|
|
4164
|
-
/******/ // Check if module is in cache
|
|
4165
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
4166
|
-
/******/ if (cachedModule !== undefined) {
|
|
4167
|
-
/******/ return cachedModule.exports;
|
|
4168
|
-
/******/ }
|
|
4169
|
-
/******/ // Create a new module (and put it into the cache)
|
|
4170
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
4171
|
-
/******/ // no module.id needed
|
|
4172
|
-
/******/ // no module.loaded needed
|
|
4173
|
-
/******/ exports: {}
|
|
4174
|
-
/******/ };
|
|
4175
|
-
/******/
|
|
4176
|
-
/******/ // Execute the module function
|
|
4177
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
4178
|
-
/******/
|
|
4179
|
-
/******/ // Return the exports of the module
|
|
4180
|
-
/******/ return module.exports;
|
|
4181
|
-
/******/ }
|
|
4182
|
-
/******/
|
|
4183
|
-
/************************************************************************/
|
|
4184
|
-
var __webpack_exports__ = {};
|
|
4185
|
-
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
4186
|
-
(() => {
|
|
4187
|
-
"use strict";
|
|
4188
|
-
var exports = __webpack_exports__;
|
|
4189
|
-
|
|
4190
|
-
/*---------------------------------------------------------------------------------------------
|
|
4191
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4192
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4193
|
-
*--------------------------------------------------------------------------------------------*/
|
|
4194
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4195
|
-
exports.deactivate = exports.activate = void 0;
|
|
4196
|
-
const vscode = __webpack_require__(1);
|
|
4197
|
-
const notebookSerializer_1 = __webpack_require__(2);
|
|
4198
|
-
const cellIdService_1 = __webpack_require__(8);
|
|
4199
|
-
const notebookImagePaste_1 = __webpack_require__(9);
|
|
4200
|
-
const notebookAttachmentCleaner_1 = __webpack_require__(11);
|
|
4201
|
-
function activate(context) {
|
|
4202
|
-
const serializer = new notebookSerializer_1.NotebookSerializer(context);
|
|
4203
|
-
(0, cellIdService_1.ensureAllNewCellsHaveCellIds)(context);
|
|
4204
|
-
context.subscriptions.push(vscode.workspace.registerNotebookSerializer('jupyter-notebook', serializer, {
|
|
4205
|
-
transientOutputs: false,
|
|
4206
|
-
transientCellMetadata: {
|
|
4207
|
-
breakpointMargin: true,
|
|
4208
|
-
custom: false,
|
|
4209
|
-
attachments: false
|
|
4210
|
-
},
|
|
4211
|
-
cellContentMetadata: {
|
|
4212
|
-
attachments: true
|
|
4213
|
-
}
|
|
4214
|
-
}));
|
|
4215
|
-
context.subscriptions.push(vscode.workspace.registerNotebookSerializer('interactive', serializer, {
|
|
4216
|
-
transientOutputs: false,
|
|
4217
|
-
transientCellMetadata: {
|
|
4218
|
-
breakpointMargin: true,
|
|
4219
|
-
custom: false,
|
|
4220
|
-
attachments: false
|
|
4221
|
-
},
|
|
4222
|
-
cellContentMetadata: {
|
|
4223
|
-
attachments: true
|
|
4224
|
-
}
|
|
4225
|
-
}));
|
|
4226
|
-
vscode.languages.registerCodeLensProvider({ pattern: '**/*.ipynb' }, {
|
|
4227
|
-
provideCodeLenses: (document) => {
|
|
4228
|
-
if (document.uri.scheme === 'vscode-notebook-cell' ||
|
|
4229
|
-
document.uri.scheme === 'vscode-notebook-cell-metadata' ||
|
|
4230
|
-
document.uri.scheme === 'vscode-notebook-cell-output') {
|
|
4231
|
-
return [];
|
|
4232
|
-
}
|
|
4233
|
-
const codelens = new vscode.CodeLens(new vscode.Range(0, 0, 0, 0), { title: 'Open in Notebook Editor', command: 'ipynb.openIpynbInNotebookEditor', arguments: [document.uri] });
|
|
4234
|
-
return [codelens];
|
|
4235
|
-
}
|
|
4236
|
-
});
|
|
4237
|
-
context.subscriptions.push(vscode.commands.registerCommand('ipynb.newUntitledIpynb', async () => {
|
|
4238
|
-
const language = 'python';
|
|
4239
|
-
const cell = new vscode.NotebookCellData(vscode.NotebookCellKind.Code, '', language);
|
|
4240
|
-
const data = new vscode.NotebookData([cell]);
|
|
4241
|
-
data.metadata = {
|
|
4242
|
-
custom: {
|
|
4243
|
-
cells: [],
|
|
4244
|
-
metadata: {},
|
|
4245
|
-
nbformat: 4,
|
|
4246
|
-
nbformat_minor: 2
|
|
4247
|
-
}
|
|
4248
|
-
};
|
|
4249
|
-
const doc = await vscode.workspace.openNotebookDocument('jupyter-notebook', data);
|
|
4250
|
-
await vscode.window.showNotebookDocument(doc);
|
|
4251
|
-
}));
|
|
4252
|
-
context.subscriptions.push(vscode.commands.registerCommand('ipynb.openIpynbInNotebookEditor', async (uri) => {
|
|
4253
|
-
if (vscode.window.activeTextEditor?.document.uri.toString() === uri.toString()) {
|
|
4254
|
-
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
|
|
4255
|
-
}
|
|
4256
|
-
const document = await vscode.workspace.openNotebookDocument(uri);
|
|
4257
|
-
await vscode.window.showNotebookDocument(document);
|
|
4258
|
-
}));
|
|
4259
|
-
context.subscriptions.push((0, notebookImagePaste_1.notebookImagePasteSetup)());
|
|
4260
|
-
const enabled = vscode.workspace.getConfiguration('ipynb').get('pasteImagesAsAttachments.enabled', false);
|
|
4261
|
-
if (enabled) {
|
|
4262
|
-
const cleaner = new notebookAttachmentCleaner_1.AttachmentCleaner();
|
|
4263
|
-
context.subscriptions.push(cleaner);
|
|
4264
|
-
}
|
|
4265
|
-
// Update new file contribution
|
|
4266
|
-
vscode.extensions.onDidChange(() => {
|
|
4267
|
-
vscode.commands.executeCommand('setContext', 'jupyterEnabled', vscode.extensions.getExtension('ms-toolsai.jupyter'));
|
|
4268
|
-
});
|
|
4269
|
-
vscode.commands.executeCommand('setContext', 'jupyterEnabled', vscode.extensions.getExtension('ms-toolsai.jupyter'));
|
|
4270
|
-
return {
|
|
4271
|
-
exportNotebook: (notebook) => {
|
|
4272
|
-
return exportNotebook(notebook, serializer);
|
|
4273
|
-
},
|
|
4274
|
-
setNotebookMetadata: async (resource, metadata) => {
|
|
4275
|
-
const document = vscode.workspace.notebookDocuments.find(doc => doc.uri.toString() === resource.toString());
|
|
4276
|
-
if (!document) {
|
|
4277
|
-
return false;
|
|
4278
|
-
}
|
|
4279
|
-
const edit = new vscode.WorkspaceEdit();
|
|
4280
|
-
edit.set(resource, [vscode.NotebookEdit.updateNotebookMetadata({
|
|
4281
|
-
...document.metadata,
|
|
4282
|
-
custom: {
|
|
4283
|
-
...(document.metadata.custom ?? {}),
|
|
4284
|
-
metadata: {
|
|
4285
|
-
...(document.metadata.custom?.metadata ?? {}),
|
|
4286
|
-
...metadata
|
|
4287
|
-
},
|
|
4288
|
-
}
|
|
4289
|
-
})]);
|
|
4290
|
-
return vscode.workspace.applyEdit(edit);
|
|
4291
|
-
},
|
|
4292
|
-
};
|
|
4293
|
-
}
|
|
4294
|
-
exports.activate = activate;
|
|
4295
|
-
function exportNotebook(notebook, serializer) {
|
|
4296
|
-
return serializer.serializeNotebookToString(notebook);
|
|
4297
|
-
}
|
|
4298
|
-
function deactivate() { }
|
|
4299
|
-
exports.deactivate = deactivate;
|
|
4300
|
-
|
|
4301
|
-
})();
|
|
4302
|
-
|
|
4303
|
-
var __webpack_export_target__ = exports;
|
|
4304
|
-
for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
|
|
4305
|
-
if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
4306
|
-
/******/ })()
|
|
4307
|
-
;
|
|
4308
|
-
//# sourceMappingURL=ipynbMain.js.map
|