CyberChef/modules/Regex.js

2 lines
321 KiB
JavaScript
Raw Permalink Normal View History

2025-04-05 18:13:43 +00:00
/*! For license information please see Regex.js.LICENSE.txt */
(()=>{var u={67526:(u,e)=>{"use strict";e.byteLength=function(u){var e=o(u),t=e[0],r=e[1];return 3*(t+r)/4-r},e.toByteArray=function(u){var e,t,n=o(u),a=n[0],i=n[1],c=new d(function(u,e,t){return 3*(e+t)/4-t}(0,a,i)),f=0,s=i>0?a-4:a;for(t=0;t<s;t+=4)e=r[u.charCodeAt(t)]<<18|r[u.charCodeAt(t+1)]<<12|r[u.charCodeAt(t+2)]<<6|r[u.charCodeAt(t+3)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===i&&(e=r[u.charCodeAt(t)]<<2|r[u.charCodeAt(t+1)]>>4,c[f++]=255&e),1===i&&(e=r[u.charCodeAt(t)]<<10|r[u.charCodeAt(t+1)]<<4|r[u.charCodeAt(t+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(u){for(var e,r=u.length,d=r%3,n=[],a=16383,o=0,c=r-d;o<c;o+=a)n.push(i(u,o,o+a>c?c:o+a));return 1===d?(e=u[r-1],n.push(t[e>>2]+t[e<<4&63]+"==")):2===d&&(e=(u[r-2]<<8)+u[r-1],n.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"=")),n.join("")};for(var t=[],r=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)t[a]=n[a],r[n.charCodeAt(a)]=a;function o(u){var e=u.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=u.indexOf("=");return-1===t&&(t=e),[t,t===e?0:4-t%4]}function i(u,e,r){for(var d,n,a=[],o=e;o<r;o+=3)d=(u[o]<<16&16711680)+(u[o+1]<<8&65280)+(255&u[o+2]),a.push(t[(n=d)>>18&63]+t[n>>12&63]+t[n>>6&63]+t[63&n]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},48287:(u,e,t)=>{"use strict";const r=t(67526),d=t(251),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.INSPECT_MAX_BYTES=50;const a=2147483647;function o(u){if(u>a)throw new RangeError('The value "'+u+'" is invalid for option "size"');const e=new Uint8Array(u);return Object.setPrototypeOf(e,i.prototype),e}function i(u,e,t){if("number"==typeof u){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return s(u)}return c(u,e,t)}function c(u,e,t){if("string"==typeof u)return function(u,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=0|D(u,e);let r=o(t);const d=r.write(u,e);return d!==t&&(r=r.slice(0,d)),r}(u,e);if(ArrayBuffer.isView(u))return function(u){if(q(u,Uint8Array)){const e=new Uint8Array(u);return p(e.buffer,e.byteOffset,e.byteLength)}return l(u)}(u);if(null==u)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(q(u,ArrayBuffer)||u&&q(u.buffer,ArrayBuffer))return p(u,e,t);if("undefined"!=typeof SharedArrayBuffer&&(q(u,SharedArrayBuffer)||u&&q(u.buffer,SharedArrayBuffer)))return p(u,e,t);if("number"==typeof u)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=u.valueOf&&u.valueOf();if(null!=r&&r!==u)return i.from(r,e,t);const d=function(u){if(i.isBuffer(u)){const e=0|h(u.length),t=o(e);return 0===t.length||u.copy(t,0,0,e),t}return void 0!==u.length?"number"!=typeof u.length||J(u.length)?o(0):l(u):"Buffer"===u.type&&Array.isArray(u.data)?l(u.data):void 0}(u);if(d)return d;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof u[Symbol.toPrimitive])return i.from(u[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}function f(u){if("number"!=typeof u)throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function s(u){return f(u),o(u<0?0:0|h(u))}function l(u){const e=u.length<0?0:0|h(u.length),t=o(e);for(let r=0;r<e;r+=1)t[r]=255&u[r];return t}function p(u,e,t){if(e<0||u.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(u.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===t?new Uint8Array(u):void 0===t?new Uint8Array(u,e):new Uint8Array(u,e,t),Object.setPrototypeOf(r,i.prototype),r}functi