index.cjs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. 'use strict';
  2. function getDefaultExportFromCjs (x) {
  3. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  4. }
  5. const CRC_TABLE = new Int32Array([
  6. 0,
  7. 1996959894,
  8. 3993919788,
  9. 2567524794,
  10. 124634137,
  11. 1886057615,
  12. 3915621685,
  13. 2657392035,
  14. 249268274,
  15. 2044508324,
  16. 3772115230,
  17. 2547177864,
  18. 162941995,
  19. 2125561021,
  20. 3887607047,
  21. 2428444049,
  22. 498536548,
  23. 1789927666,
  24. 4089016648,
  25. 2227061214,
  26. 450548861,
  27. 1843258603,
  28. 4107580753,
  29. 2211677639,
  30. 325883990,
  31. 1684777152,
  32. 4251122042,
  33. 2321926636,
  34. 335633487,
  35. 1661365465,
  36. 4195302755,
  37. 2366115317,
  38. 997073096,
  39. 1281953886,
  40. 3579855332,
  41. 2724688242,
  42. 1006888145,
  43. 1258607687,
  44. 3524101629,
  45. 2768942443,
  46. 901097722,
  47. 1119000684,
  48. 3686517206,
  49. 2898065728,
  50. 853044451,
  51. 1172266101,
  52. 3705015759,
  53. 2882616665,
  54. 651767980,
  55. 1373503546,
  56. 3369554304,
  57. 3218104598,
  58. 565507253,
  59. 1454621731,
  60. 3485111705,
  61. 3099436303,
  62. 671266974,
  63. 1594198024,
  64. 3322730930,
  65. 2970347812,
  66. 795835527,
  67. 1483230225,
  68. 3244367275,
  69. 3060149565,
  70. 1994146192,
  71. 31158534,
  72. 2563907772,
  73. 4023717930,
  74. 1907459465,
  75. 112637215,
  76. 2680153253,
  77. 3904427059,
  78. 2013776290,
  79. 251722036,
  80. 2517215374,
  81. 3775830040,
  82. 2137656763,
  83. 141376813,
  84. 2439277719,
  85. 3865271297,
  86. 1802195444,
  87. 476864866,
  88. 2238001368,
  89. 4066508878,
  90. 1812370925,
  91. 453092731,
  92. 2181625025,
  93. 4111451223,
  94. 1706088902,
  95. 314042704,
  96. 2344532202,
  97. 4240017532,
  98. 1658658271,
  99. 366619977,
  100. 2362670323,
  101. 4224994405,
  102. 1303535960,
  103. 984961486,
  104. 2747007092,
  105. 3569037538,
  106. 1256170817,
  107. 1037604311,
  108. 2765210733,
  109. 3554079995,
  110. 1131014506,
  111. 879679996,
  112. 2909243462,
  113. 3663771856,
  114. 1141124467,
  115. 855842277,
  116. 2852801631,
  117. 3708648649,
  118. 1342533948,
  119. 654459306,
  120. 3188396048,
  121. 3373015174,
  122. 1466479909,
  123. 544179635,
  124. 3110523913,
  125. 3462522015,
  126. 1591671054,
  127. 702138776,
  128. 2966460450,
  129. 3352799412,
  130. 1504918807,
  131. 783551873,
  132. 3082640443,
  133. 3233442989,
  134. 3988292384,
  135. 2596254646,
  136. 62317068,
  137. 1957810842,
  138. 3939845945,
  139. 2647816111,
  140. 81470997,
  141. 1943803523,
  142. 3814918930,
  143. 2489596804,
  144. 225274430,
  145. 2053790376,
  146. 3826175755,
  147. 2466906013,
  148. 167816743,
  149. 2097651377,
  150. 4027552580,
  151. 2265490386,
  152. 503444072,
  153. 1762050814,
  154. 4150417245,
  155. 2154129355,
  156. 426522225,
  157. 1852507879,
  158. 4275313526,
  159. 2312317920,
  160. 282753626,
  161. 1742555852,
  162. 4189708143,
  163. 2394877945,
  164. 397917763,
  165. 1622183637,
  166. 3604390888,
  167. 2714866558,
  168. 953729732,
  169. 1340076626,
  170. 3518719985,
  171. 2797360999,
  172. 1068828381,
  173. 1219638859,
  174. 3624741850,
  175. 2936675148,
  176. 906185462,
  177. 1090812512,
  178. 3747672003,
  179. 2825379669,
  180. 829329135,
  181. 1181335161,
  182. 3412177804,
  183. 3160834842,
  184. 628085408,
  185. 1382605366,
  186. 3423369109,
  187. 3138078467,
  188. 570562233,
  189. 1426400815,
  190. 3317316542,
  191. 2998733608,
  192. 733239954,
  193. 1555261956,
  194. 3268935591,
  195. 3050360625,
  196. 752459403,
  197. 1541320221,
  198. 2607071920,
  199. 3965973030,
  200. 1969922972,
  201. 40735498,
  202. 2617837225,
  203. 3943577151,
  204. 1913087877,
  205. 83908371,
  206. 2512341634,
  207. 3803740692,
  208. 2075208622,
  209. 213261112,
  210. 2463272603,
  211. 3855990285,
  212. 2094854071,
  213. 198958881,
  214. 2262029012,
  215. 4057260610,
  216. 1759359992,
  217. 534414190,
  218. 2176718541,
  219. 4139329115,
  220. 1873836001,
  221. 414664567,
  222. 2282248934,
  223. 4279200368,
  224. 1711684554,
  225. 285281116,
  226. 2405801727,
  227. 4167216745,
  228. 1634467795,
  229. 376229701,
  230. 2685067896,
  231. 3608007406,
  232. 1308918612,
  233. 956543938,
  234. 2808555105,
  235. 3495958263,
  236. 1231636301,
  237. 1047427035,
  238. 2932959818,
  239. 3654703836,
  240. 1088359270,
  241. 936918e3,
  242. 2847714899,
  243. 3736837829,
  244. 1202900863,
  245. 817233897,
  246. 3183342108,
  247. 3401237130,
  248. 1404277552,
  249. 615818150,
  250. 3134207493,
  251. 3453421203,
  252. 1423857449,
  253. 601450431,
  254. 3009837614,
  255. 3294710456,
  256. 1567103746,
  257. 711928724,
  258. 3020668471,
  259. 3272380065,
  260. 1510334235,
  261. 755167117
  262. ]);
  263. function ensureBuffer(input) {
  264. if (Buffer.isBuffer(input)) {
  265. return input;
  266. }
  267. if (typeof input === "number") {
  268. return Buffer.alloc(input);
  269. } else if (typeof input === "string") {
  270. return Buffer.from(input);
  271. } else {
  272. throw new Error("input must be buffer, number, or string, received " + typeof input);
  273. }
  274. }
  275. function bufferizeInt(num) {
  276. const tmp = ensureBuffer(4);
  277. tmp.writeInt32BE(num, 0);
  278. return tmp;
  279. }
  280. function _crc32(buf, previous) {
  281. buf = ensureBuffer(buf);
  282. if (Buffer.isBuffer(previous)) {
  283. previous = previous.readUInt32BE(0);
  284. }
  285. let crc = ~~previous ^ -1;
  286. for (var n = 0; n < buf.length; n++) {
  287. crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
  288. }
  289. return crc ^ -1;
  290. }
  291. function crc32() {
  292. return bufferizeInt(_crc32.apply(null, arguments));
  293. }
  294. crc32.signed = function() {
  295. return _crc32.apply(null, arguments);
  296. };
  297. crc32.unsigned = function() {
  298. return _crc32.apply(null, arguments) >>> 0;
  299. };
  300. var bufferCrc32 = crc32;
  301. const index = /*@__PURE__*/getDefaultExportFromCjs(bufferCrc32);
  302. module.exports = index;