1/* eslint-disable */ 2(function (exports) { 3 'use strict'; 4 5 /** 6 * [js-md5]{@link https://github.com/emn178/js-md5} 7 * 8 * @namespace md5 9 * @version 0.7.3 10 * @author Chen, Yi-Cyuan [[email protected]] 11 * @copyright Chen, Yi-Cyuan 2014-2017 12 * @license MIT 13 */ 14 15 /** 16 * Modify list for integration with Bitrix Framework: 17 * - removed integration with third-party package builders; 18 * - add import & export for work in Bitrix CoreJS extensions; 19 */ 20 21 /** 22 * @method md5� 23 * @description Md5 hash function, export to global in browsers. 24 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 25 * @returns {String} md5 hashes 26 * @example 27 * md5(''); // d41d8cd98f00b204e9800998ecf8427e 28 * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6 29 * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0 30 * 31 * // It also supports UTF-8 encoding 32 * md5('??'); // a7bac2239fcdcb3a067903d8077c4a07 33 * 34 * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` 35 * md5([]); // d41d8cd98f00b204e9800998ecf8427e 36 * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e 37 */ 38 var md5 = function () { 39 40 var ERROR = 'input is invalid type'; 41 var WINDOW = typeof window === 'object'; 42 var root = WINDOW ? window : {}; 43 if (root.JS_MD5_NO_WINDOW) { 44 WINDOW = false;
45 } 46 var WEB_WORKER = !WINDOW && typeof self === 'object'; 47 var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; 48 if (NODE_JS) { 49 root = global; 50 } else if (WEB_WORKER) { 51 root = self; 52 } 53 var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && typeof module === 'object' && module.exports; 54 var AMD = typeof define === 'function' && define.amd; 55 var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; 56 var HEX_CHARS = '0123456789abcdef'.split(''); 57 var EXTRA = [128, 32768, 8388608, -2147483648]; 58 var SHIFT = [0, 8, 16, 24]; 59 var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64']; 60 var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); 61 var blocks = [], 62 buffer8; 63 if (ARRAY_BUFFER) { 64 var buffer = new ArrayBuffer(68); 65 buffer8 = new Uint8Array(buffer); 66 blocks = new Uint32Array(buffer); 67 } 68 if (root.JS_MD5_NO_NODE_JS || !Array.isArray) { 69 Array.isArray = function (obj) { 70 return Object.prototype.toString.call(obj) === '[object Array]'; 71 }; 72 } 73 if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) { 74 ArrayBuffer.isView = function (obj) { 75 return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer; 76 }; 77 } 78 79 /** 80 * @method hex 81 * @memberof md5 82 * @description Output hash as hex string 83 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 84 * @returns {String} Hex string 85 * @example 86 * md5.hex('The quick brown fox jumps over the lazy dog'); 87 * // equal to 88 * md5('The quick brown fox jumps over the lazy dog'); 89 */ 90 /** 91 * @method digest 92 * @memberof md5 93 * @description Output hash as bytes array 94 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 95 * @returns {Array} Bytes array 96 * @example 97 * md5.digest('The quick brown fox jumps over the lazy dog'); 98 */ 99 /** 100 * @method array 101 * @memberof md5 102 * @description Output hash as bytes array 103 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 104 * @returns {Array} Bytes array 105 * @example 106 * md5.array('The quick brown fox jumps over the lazy dog'); 107 */ 108 /** 109 * @method arrayBuffer 110 * @memberof md5 111 * @description Output hash as ArrayBuffer 112 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 113 * @returns {ArrayBuffer} ArrayBuffer 114 * @example 115 * md5.arrayBuffer('The quick brown fox jumps over the lazy dog'); 116 */ 117 /** 118 * @method buffer 119 * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. 120 * @memberof md5 121 * @description Output hash as ArrayBuffer 122 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 123 * @returns {ArrayBuffer} ArrayBuffer 124 * @example 125 * md5.buffer('The quick brown fox jumps over the lazy dog'); 126 */ 127 /** 128 * @method base64 129 * @memberof md5 130 * @description Output hash as base64 string 131 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 132 * @returns {String} base64 string 133 * @example 134 * md5.base64('The quick brown fox jumps over the lazy dog'); 135 */ 136 var createOutputMethod = function (outputType) { 137 return function (message) { 138 return new Md5(true).update(message)[outputType](); 139 }; 140 }; 141 142 /** 143 * @method create 144 * @memberof md5 145 * @description Create Md5 object 146 * @returns {Md5} Md5 object. 147 * @example 148 * var hash = md5.create(); 149 */ 150 /** 151 * @method update 152 * @memberof md5 153 * @description Create and update Md5 object 154 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 155 * @returns {Md5} Md5 object. 156 * @example 157 * var hash = md5.update('The quick brown fox jumps over the lazy dog'); 158 * // equal to 159 * var hash = md5.create(); 160 * hash.update('The quick brown fox jumps over the lazy dog'); 161 */ 162 var createMethod = function () { 163 var method = createOutputMethod('hex'); 164 if (NODE_JS) {
165 method = nodeWrap(method); 166 } 167 method.create = function () { 168 return new Md5(); 169 }; 170 method.update = function (message) { 171 return method.create().update(message); 172 }; 173 for (var i = 0; i < OUTPUT_TYPES.length; ++i) { 174 var type = OUTPUT_TYPES[i]; 175 method[type] = createOutputMethod(type); 176 } 177 return method; 178 }; 179 var nodeWrap = function (method) { 180 var crypto = eval("require('crypto')"); 181 var Buffer = eval("require('buffer').Buffer"); 182 var nodeMethod = function (message) { 183 if (typeof message === 'string') { 184 return crypto.createHash('md5').update(message, 'utf8').digest('hex'); 185 } else { 186 if (message === null || message === undefined) { 187 throw ERROR; 188 } else if (message.constructor === ArrayBuffer) { 189 message = new Uint8Array(message); 190 } 191 } 192 if (Array.isArray(message) || ArrayBuffer.isView(message) || message.constructor === Buffer) { 193 return crypto.createHash('md5').update(new Buffer(message)).digest('hex'); 194 } else { 195 return method(message); 196 } 197 }; 198 return nodeMethod; 199 }; 200 201 /** 202 * Md5 class 203 * @class Md5 204 * @description This is internal class. 205 * @see {@link md5.create} 206 */ 207 function Md5(sharedMemory) { 208 if (sharedMemory) { 209 blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; 210 this.blocks = blocks; 211 this.buffer8 = buffer8; 212 } else { 213 if (ARRAY_BUFFER) { 214 var buffer = new ArrayBuffer(68); 215 this.buffer8 = new Uint8Array(buffer); 216 this.blocks = new Uint32Array(buffer); 217 } else { 218 this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; 219 } 220 } 221 this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0; 222 this.finalized = this.hashed = false; 223 this.first = true; 224 } 225 226 /** 227 * @method update 228 * @memberof Md5 229 * @instance 230 * @description Update hash 231 * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash 232 * @returns {Md5} Md5 object. 233 * @see {@link md5.update} 234 */ 235 Md5.prototype.update = function (message) { 236 if (this.finalized) { 237 return; 238 } 239 var notString, 240 type = typeof message; 241 if (type !== 'string') { 242 if (type === 'object') { 243 if (message === null) { 244 throw ERROR; 245 } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { 246 message = new Uint8Array(message); 247 } else if (!Array.isArray(message)) { 248 if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) { 249 throw ERROR; 250 } 251 } 252 } else { 253 throw ERROR; 254 } 255 notString = true; 256 } 257 var code, 258 index = 0, 259 i, 260 length = message.length, 261 blocks = this.blocks; 262 var buffer8 = this.buffer8; 263 while (index < length) { 264 if (this.hashed) { 265 this.hashed = false; 266 blocks[0] = blocks[16]; 267 blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; 268 } 269 if (notString) { 270 if (ARRAY_BUFFER) { 271 for (i = this.start; index < length && i < 64; ++index) { 272 buffer8[i++] = message[index]; 273 } 274 } else { 275 for (i = this.start; index < length && i < 64; ++index) { 276 blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; 277 } 278 } 279 } else { 280 if (ARRAY_BUFFER) { 281 for (i = this.start; index < length && i < 64; ++index) { 282 code = message.charCodeAt(index); 283 if (code < 0x80) { 284 buffer8[i++] = code; 285 } else if (code < 0x800) { 286 buffer8[i++] = 0xc0 | code >> 6; 287 buffer8[i++] = 0x80 | code & 0x3f; 288 } else if (code < 0xd800 || code >= 0xe000) { 289 buffer8[i++] = 0xe0 | code >> 12; 290 buffer8[i++] = 0x80 | code >> 6 & 0x3f; 291 buffer8[i++] = 0x80 | code & 0x3f; 292 } else { 293 code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);
294 buffer8[i++] = 0xf0 | code >> 18; 295 buffer8[i++] = 0x80 | code >> 12 & 0x3f; 296 buffer8[i++] = 0x80 | code >> 6 & 0x3f; 297 buffer8[i++] = 0x80 | code & 0x3f; 298 } 299 } 300 } else { 301 for (i = this.start; index < length && i < 64; ++index) { 302 code = message.charCodeAt(index); 303 if (code < 0x80) { 304 blocks[i >> 2] |= code << SHIFT[i++ & 3]; 305 } else if (code < 0x800) { 306 blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3]; 307 blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3]; 308 } else if (code < 0xd800 || code >= 0xe000) { 309 blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3]; 310 blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3]; 311 blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3]; 312 } else { 313 code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff); 314 blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3]; 315 blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3]; 316 blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3]; 317 blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3]; 318 } 319 } 320 } 321 } 322 this.lastByteIndex = i; 323 this.bytes += i - this.start; 324 if (i >= 64) { 325 this.start = i - 64; 326 this.hash(); 327 this.hashed = true; 328 } else { 329 this.start = i; 330 } 331 } 332 if (this.bytes > 4294967295) { 333 this.hBytes += this.bytes / 4294967296 << 0; 334 this.bytes = this.bytes % 4294967296; 335 } 336 return this; 337 }; 338 Md5.prototype.finalize = function () { 339 if (this.finalized) { 340 return; 341 } 342 this.finalized = true; 343 var blocks = this.blocks, 344 i = this.lastByteIndex; 345 blocks[i >> 2] |= EXTRA[i & 3]; 346 if (i >= 56) { 347 if (!this.hashed) { 348 this.hash(); 349 } 350 blocks[0] = blocks[16]; 351 blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; 352 } 353 blocks[14] = this.bytes << 3; 354 blocks[15] = this.hBytes << 3 | this.bytes >>> 29; 355 this.hash(); 356 }; 357 Md5.prototype.hash = function () { 358 var a, 359 b, 360 c, 361 d, 362 bc, 363 da, 364 blocks = this.blocks; 365 if (this.first) { 366 a = blocks[0] - 680876937; 367 a = (a << 7 | a >>> 25) - 271733879 << 0; 368 d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708; 369 d = (d << 12 | d >>> 20) + a << 0; 370 c = (-271733879 ^ d & (a ^ -271733879)) + blocks[2] - 1126478375; 371 c = (c << 17 | c >>> 15) + d << 0; 372 b = (a ^ c & (d ^ a)) + blocks[3] - 1316259209; 373 b = (b << 22 | b >>> 10) + c << 0; 374 } else { 375 a = this.h0; 376 b = this.h1; 377 c = this.h2; 378 d = this.h3; 379 a += (d ^ b & (c ^ d)) + blocks[0] - 680876936; 380 a = (a << 7 | a >>> 25) + b << 0; 381 d += (c ^ a & (b ^ c)) + blocks[1] - 389564586; 382 d = (d << 12 | d >>> 20) + a << 0; 383 c += (b ^ d & (a ^ b)) + blocks[2] + 606105819; 384 c = (c << 17 | c >>> 15) + d << 0; 385 b += (a ^ c & (d ^ a)) + blocks[3] - 1044525330; 386 b = (b << 22 | b >>> 10) + c << 0; 387 } 388 a += (d ^ b & (c ^ d)) + blocks[4] - 176418897; 389 a = (a << 7 | a >>> 25) + b << 0; 390 d += (c ^ a & (b ^ c)) + blocks[5] + 1200080426; 391 d = (d << 12 | d >>> 20) + a << 0; 392 c += (b ^ d & (a ^ b)) + blocks[6] - 1473231341; 393 c = (c << 17 | c >>> 15) + d << 0; 394 b += (a ^ c & (d ^ a)) + blocks[7] - 45705983; 395 b = (b << 22 | b >>> 10) + c << 0; 396 a += (d ^ b & (c ^ d)) + blocks[8] + 1770035416; 397 a = (a << 7 | a >>> 25) + b << 0; 398 d += (c ^ a & (b ^ c)) + blocks[9] - 1958414417; 399 d = (d << 12 | d >>> 20) + a << 0; 400 c += (b ^ d & (a ^ b)) + blocks[10] - 42063; 401 c = (c << 17 | c >>> 15) + d << 0; 402 b += (a ^ c & (d ^ a)) + blocks[11] - 1990404162; 403 b = (b << 22 | b >>> 10) + c << 0; 404 a += (d ^ b & (c ^ d)) + blocks[12] + 1804603682; 405 a = (a << 7 | a >>> 25) + b << 0; 406 d += (c ^ a & (b ^ c)) + blocks[13] - 40341101; 407 d = (d << 12 | d >>> 20) + a << 0; 408 c += (b ^ d & (a ^ b)) + blocks[14] - 1502002290; 409 c = (c << 17 | c >>> 15) + d << 0; 410 b += (a ^ c & (d ^ a)) + blocks[15] + 1236535329; 411 b = (b << 22 | b >>> 10) + c << 0; 412 a += (c ^ d & (b ^ c)) + blocks[1] - 165796510; 413 a = (a << 5 | a >>> 27) + b << 0; 414 d += (b ^ c & (a ^ b)) + blocks[6] - 1069501632; 415 d = (d << 9 | d >>> 23) + a << 0; 416 c += (a ^ b & (d ^ a)) + blocks[11] + 643717713; 417 c = (c << 14 | c >>> 18) + d << 0; 418 b += (d ^ a & (c ^ d)) + blocks[0] - 373897302; 419 b = (b << 20 | b >>> 12) + c << 0; 420 a += (c ^ d & (b ^ c)) + blocks[5] - 701558691; 421 a = (a << 5 | a >>> 27) + b << 0; 422 d += (b ^ c & (a ^ b)) + blocks[10] + 38016083; 423 d = (d << 9 | d >>> 23) + a << 0; 424 c += (a ^ b & (d ^ a)) + blocks[15] - 660478335; 425 c = (c << 14 | c >>> 18) + d << 0; 426 b += (d ^ a & (c ^ d)) + blocks[4] - 405537848; 427 b = (b << 20 | b >>> 12) + c << 0; 428 a += (c ^ d & (b ^ c)) + blocks[9] + 568446438; 429 a = (a << 5 | a >>> 27) + b << 0; 430 d += (b ^ c & (a ^ b)) + blocks[14] - 1019803690; 431 d = (d << 9 | d >>> 23) + a << 0; 432 c += (a ^ b & (d ^ a)) + blocks[3] - 187363961; 433 c = (c << 14 | c >>> 18) + d << 0; 434 b += (d ^ a & (c ^ d)) + blocks[8] + 1163531501; 435 b = (b << 20 | b >>> 12) + c << 0; 436 a += (c ^ d & (b ^ c)) + blocks[13] - 1444681467; 437 a = (a << 5 | a >>> 27) + b << 0; 438 d += (b ^ c & (a ^ b)) + blocks[2] - 51403784; 439 d = (d << 9 | d >>> 23) + a << 0; 440 c += (a ^ b & (d ^ a)) + blocks[7] + 1735328473; 441 c = (c << 14 | c >>> 18) + d << 0; 442 b += (d ^ a & (c ^ d)) + blocks[12] - 1926607734;
vendor: 4,774 bytes, lines 443-552
443 b = (b << 20 | b >>> 12) + c << 0; 444 bc = b ^ c; 445 a += (bc ^ d) + blocks[5] - 378558; 446 a = (a << 4 | a >>> 28) + b << 0; 447 d += (bc ^ a) + blocks[8] - 2022574463; 448 d = (d << 11 | d >>> 21) + a << 0; 449 da = d ^ a; 450 c += (da ^ b) + blocks[11] + 1839030562; 451 c = (c << 16 | c >>> 16) + d << 0; 452 b += (da ^ c) + blocks[14] - 35309556; 453 b = (b << 23 | b >>> 9) + c << 0; 454 bc = b ^ c; 455 a += (bc ^ d) + blocks[1] - 1530992060; 456 a = (a << 4 | a >>> 28) + b << 0; 457 d += (bc ^ a) + blocks[4] + 1272893353; 458 d = (d << 11 | d >>> 21) + a << 0; 459 da = d ^ a; 460 c += (da ^ b) + blocks[7] - 155497632; 461 c = (c << 16 | c >>> 16) + d << 0; 462 b += (da ^ c) + blocks[10] - 1094730640; 463 b = (b << 23 | b >>> 9) + c << 0; 464 bc = b ^ c; 465 a += (bc ^ d) + blocks[13] + 681279174; 466 a = (a << 4 | a >>> 28) + b << 0; 467 d += (bc ^ a) + blocks[0] - 358537222; 468 d = (d << 11 | d >>> 21) + a << 0; 469 da = d ^ a; 470 c += (da ^ b) + blocks[3] - 722521979; 471 c = (c << 16 | c >>> 16) + d << 0; 472 b += (da ^ c) + blocks[6] + 76029189; 473 b = (b << 23 | b >>> 9) + c << 0; 474 bc = b ^ c; 475 a += (bc ^ d) + blocks[9] - 640364487; 476 a = (a << 4 | a >>> 28) + b << 0; 477 d += (bc ^ a) + blocks[12] - 421815835; 478 d = (d << 11 | d >>> 21) + a << 0; 479 da = d ^ a; 480 c += (da ^ b) + blocks[15] + 530742520; 481 c = (c << 16 | c >>> 16) + d << 0; 482 b += (da ^ c) + blocks[2] - 995338651; 483 b = (b << 23 | b >>> 9) + c << 0; 484 a += (c ^ (b | ~d)) + blocks[0] - 198630844; 485 a = (a << 6 | a >>> 26) + b << 0; 486 d += (b ^ (a | ~c)) + blocks[7] + 1126891415; 487 d = (d << 10 | d >>> 22) + a << 0; 488 c += (a ^ (d | ~b)) + blocks[14] - 1416354905; 489 c = (c << 15 | c >>> 17) + d << 0; 490 b += (d ^ (c | ~a)) + blocks[5] - 57434055; 491 b = (b << 21 | b >>> 11) + c << 0; 492 a += (c ^ (b | ~d)) + blocks[12] + 1700485571; 493 a = (a << 6 | a >>> 26) + b << 0; 494 d += (b ^ (a | ~c)) + blocks[3] - 1894986606; 495 d = (d << 10 | d >>> 22) + a << 0; 496 c += (a ^ (d | ~b)) + blocks[10] - 1051523; 497 c = (c << 15 | c >>> 17) + d << 0; 498 b += (d ^ (c | ~a)) + blocks[1] - 2054922799; 499 b = (b << 21 | b >>> 11) + c << 0; 500 a += (c ^ (b | ~d)) + blocks[8] + 1873313359; 501 a = (a << 6 | a >>> 26) + b << 0; 502 d += (b ^ (a | ~c)) + blocks[15] - 30611744; 503 d = (d << 10 | d >>> 22) + a << 0; 504 c += (a ^ (d | ~b)) + blocks[6] - 1560198380; 505 c = (c << 15 | c >>> 17) + d << 0; 506 b += (d ^ (c | ~a)) + blocks[13] + 1309151649; 507 b = (b << 21 | b >>> 11) + c << 0; 508 a += (c ^ (b | ~d)) + blocks[4] - 145523070; 509 a = (a << 6 | a >>> 26) + b << 0; 510 d += (b ^ (a | ~c)) + blocks[11] - 1120210379; 511 d = (d << 10 | d >>> 22) + a << 0; 512 c += (a ^ (d | ~b)) + blocks[2] + 718787259; 513 c = (c << 15 | c >>> 17) + d << 0; 514 b += (d ^ (c | ~a)) + blocks[9] - 343485551; 515 b = (b << 21 | b >>> 11) + c << 0; 516 if (this.first) { 517 this.h0 = a + 1732584193 << 0; 518 this.h1 = b - 271733879 << 0; 519 this.h2 = c - 1732584194 << 0; 520 this.h3 = d + 271733878 << 0; 521 this.first = false; 522 } else { 523 this.h0 = this.h0 + a << 0; 524 this.h1 = this.h1 + b << 0; 525 this.h2 = this.h2 + c << 0; 526 this.h3 = this.h3 + d << 0; 527 } 528 }; 529 530 /** 531 * @method hex 532 * @memberof Md5 533 * @instance 534 * @description Output hash as hex string 535 * @returns {String} Hex string 536 * @see {@link md5.hex} 537 * @example 538 * hash.hex(); 539 */ 540 Md5.prototype.hex = function () { 541 this.finalize(); 542 var h0 = this.h0, 543 h1 = this.h1, 544 h2 = this.h2, 545 h3 = this.h3; 546 return HEX_CHARS[h0 >> 4 & 0x0F] + HEX_CHARS[h0 & 0x0F] + HEX_CHARS[h0 >> 12 & 0x0F] + HEX_CHARS[h0 >> 8 & 0x0F] + HEX_CHARS[h0 >> 20 & 0x0F] + HEX_CHARS[h0 >> 16 & 0x0F] + HEX_CHARS[h0 >> 28 & 0x0F] + HEX_CHARS[h0 >> 24 & 0x0F] + HEX_CHARS[h1 >> 4 & 0x0F] + HEX_CHARS[h1 & 0x0F] + HEX_CHARS[h1 >> 12 & 0x0F] + HEX_CHARS[h1 >> 8 & 0x0F] + HEX_CHARS[h1 >> 20 & 0x0F] + HEX_CHARS[h1 >> 16 & 0x0F] + HEX_CHARS[h1 >> 28 & 0x0F] + HEX_CHARS[h1 >> 24 & 0x0F] + HEX_CHARS[h2 >> 4 & 0x0F] + HEX_CHARS[h2 & 0x0F] + HEX_CHARS[h2 >> 12 & 0x0F] + HEX_CHARS[h2 >> 8 & 0x0F] + HEX_CHARS[h2 >> 20 & 0x0F] + HEX_CHARS[h2 >> 16 & 0x0F] + HEX_CHARS[h2 >> 28 & 0x0F] + HEX_CHARS[h2 >> 24 & 0x0F] + HEX_CHARS[h3 >> 4 & 0x0F] + HEX_CHARS[h3 & 0x0F] + HEX_CHARS[h3 >> 12 & 0x0F] + HEX_CHARS[h3 >> 8 & 0x0F] + HEX_CHARS[h3 >> 20 & 0x0F] + HEX_CHARS[h3 >> 16 & 0x0F] + HEX_CHARS[h3 >> 28 & 0x0F] + HEX_CHARS[h3 >> 24 & 0x0F]; 547 }; 548 549 /** 550 * @method toString 551 * @memberof Md5 552 * @instance
553 * @description Output hash as hex string 554 * @returns {String} Hex string 555 * @see {@link md5.hex} 556 * @example 557 * hash.toString(); 558 */ 559 Md5.prototype.toString = Md5.prototype.hex; 560 561 /** 562 * @method digest 563 * @memberof Md5 564 * @instance 565 * @description Output hash as bytes array 566 * @returns {Array} Bytes array 567 * @see {@link md5.digest} 568 * @example 569 * hash.digest(); 570 */ 571 Md5.prototype.digest = function () { 572 this.finalize(); 573 var h0 = this.h0, 574 h1 = this.h1, 575 h2 = this.h2, 576 h3 = this.h3; 577 return [h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >> 24 & 0xFF]; 578 }; 579 580 /** 581 * @method array 582 * @memberof Md5 583 * @instance 584 * @description Output hash as bytes array 585 * @returns {Array} Bytes array 586 * @see {@link md5.array} 587 * @example 588 * hash.array(); 589 */ 590 Md5.prototype.array = Md5.prototype.digest; 591 592 /** 593 * @method arrayBuffer 594 * @memberof Md5 595 * @instance 596 * @description Output hash as ArrayBuffer 597 * @returns {ArrayBuffer} ArrayBuffer 598 * @see {@link md5.arrayBuffer} 599 * @example 600 * hash.arrayBuffer(); 601 */ 602 Md5.prototype.arrayBuffer = function () { 603 this.finalize(); 604 var buffer = new ArrayBuffer(16); 605 var blocks = new Uint32Array(buffer); 606 blocks[0] = this.h0; 607 blocks[1] = this.h1; 608 blocks[2] = this.h2; 609 blocks[3] = this.h3; 610 return buffer; 611 }; 612 613 /** 614 * @method buffer 615 * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. 616 * @memberof Md5 617 * @instance 618 * @description Output hash as ArrayBuffer 619 * @returns {ArrayBuffer} ArrayBuffer 620 * @see {@link md5.buffer} 621 * @example 622 * hash.buffer(); 623 */ 624 Md5.prototype.buffer = Md5.prototype.arrayBuffer; 625 626 /** 627 * @method base64 628 * @memberof Md5 629 * @instance 630 * @description Output hash as base64 string 631 * @returns {String} base64 string 632 * @see {@link md5.base64} 633 * @example 634 * hash.base64(); 635 */ 636 Md5.prototype.base64 = function () { 637 var v1, 638 v2, 639 v3, 640 base64Str = '', 641 bytes = this.array(); 642 for (var i = 0; i < 15;) { 643 v1 = bytes[i++]; 644 v2 = bytes[i++]; 645 v3 = bytes[i++]; 646 base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] + BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] + BASE64_ENCODE_CHAR[v3 & 63]; 647 } 648 v1 = bytes[i]; 649 base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + BASE64_ENCODE_CHAR[v1 << 4 & 63] + '=='; 650 return base64Str; 651 }; 652 return createMethod(); 653 }(); 654 655 exports.md5 = md5; 656 657}((this.BX = this.BX || {}))); 658//# sourceMappingURL=md5.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.