Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Crypto API for JavaScript - https://github.com/nf404/crypto-api
The MIT License (MIT)
Copyright (c) 2015 nf404
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Basic JavaScript BN library - subset useful for RSA encryption.
This software is covered under the following copyright:
Copyright (c) 2003-2005 Tom Wu
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
In addition, the following condition applies:
All redistributions must retain an intact copy of this copyright notice
and disclaimer.
Address all questions regarding this license to:
Tom Wu
tjw@cs.Stanford.EDU
*/
var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;varlowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=b
this.sign()},this.verify=function(a){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecpubhex&&"undefined"!=typeof this.eccurvename){var b=new KJUR.crypto.ECDSA({curve:this.eccurvename});return b.verifyHex(this.sHashHex,a,this.ecpubhex)}if(this.pubKey instanceof RSAKey&&"rsaandmgf1"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,a,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof RSAKey&&"rsa"==this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,a);if(this.pubKey instanceof KJUR.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,a);if(this.pubKey instanceof KJUR.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,a);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(a,b){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.initVerifyByPublicKey=function(a){throw"initVerifyByPublicKey(rsaPubKeyy) not supported for this alg:prov="+this.algProvName},this.initVerifyByCertificatePEM=function(a){throw"initVerifyByCertificatePEM(certPEM) not supported for this alg:prov="+this.algProvName},this.initSign=function(a){throw"initSign(prvKey) not supported for this alg:prov="+this.algProvName},this.updateString=function(a){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(a){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(a){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(a){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(a){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=a,void 0!==a&&(void 0!==a.alg&&(this.algName=a.alg,void 0===a.prov?this.provName=KJUR.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=a.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==a.psssaltlen&&(this.pssSaltLen=a.psssaltlen),void 0!==a.prvkeypem)){if(void 0!==a.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{var b=new RSAKey;b.readPrivateKeyFromPEMString(a.prvkeypem),this.initSign(b)}catch(a){throw"fatal error to load pem private key: "+a}}},KJUR.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.crypto&&KJUR.crypto||(KJUR.crypto={}),KJUR.crypto.DSA=function(){function a(a,b,c,e,f,g){var h=KJUR.crypto.Util.hashString(b,a.toLowerCase()),h=h.substr(0,f.bitLength()/4),i=new BigInteger(h,16),j=d(BigInteger.ONE.add(BigInteger.ONE),f.subtract(BigInteger.ONE)),k=c.modPow(j,e).mod(f),l=j.modInverse(f).multiply(i.add(g.multiply(k))).mod(f),m=new Array;return m[0]=k,m[1]=l,m}function b(a){var b=openpgp.config.config.prefer_hash_algorithm;switch(Math.round(a.bitLength()/8)){case 20:return 2!=b&&b>11&&10!=b&&b<8?2:b;case 28:return b>11&&b<8?11:b;case 32:return b>10&&b<8?8:b;default:return util.print_debug("DSA select hash algorithm: returning null for an unknown length of q"),null}}function c(a,b,c,d,e,f,g,h){var i=KJUR.crypto.Util.hashString(d,a.toLowerCase()),i=i.substr(0,f.bitLength()/4),j=new BigInteger(i,16);if(BigInteger.ZERO.compareTo(b)>0||b.compareTo(f)>0||BigInteger.ZERO.compareTo(c)>0||c.compareTo(f)>0)return util.print_error("invalid DSA Signature"),null;var k=c.modInverse(f),l=j.multiply(k).mod(f),m=b.multiply(k).mod(f),n=g.modPow(l,e).multiply(h.modPow(m,e)).mod(e).mod(f);return 0==n.compareTo(b)}function d(a,b){if(!(b.compareTo(a)<=0)){for(var c=b.subtr
re.monthsParse=Y,re._monthsRegex=Id,re.monthsRegex=ba,re._monthsShortRegex=Hd,re.monthsShortRegex=aa,re.week=Qb,re._week=$d,re.firstDayOfYear=Sb,re.firstDayOfWeek=Rb,re.weekdays=Wb,re._weekdays=ae,re.weekdaysMin=Yb,re._weekdaysMin=ce,re.weekdaysShort=Xb,re._weekdaysShort=be,re.weekdaysParse=Zb,re.isPM=fc,re._meridiemParse=de,re.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var se=Math.abs,te=Lc("ms"),ue=Lc("s"),ve=Lc("m"),we=Lc("h"),xe=Lc("d"),ye=Lc("w"),ze=Lc("M"),Ae=Lc("y"),Be=Nc("milliseconds"),Ce=Nc("seconds"),De=Nc("minutes"),Ee=Nc("hours"),Fe=Nc("days"),Ge=Nc("months"),He=Nc("years"),Ie=Math.round,Je={s:45,m:45,h:22,d:26,M:11},Ke=Math.abs,Le=Ia.prototype;Le.abs=Bc,Le.add=Dc,Le.subtract=Ec,Le.as=Jc,Le.asMilliseconds=te,Le.asSeconds=ue,Le.asMinutes=ve,Le.asHours=we,Le.asDays=xe,Le.asWeeks=ye,Le.asMonths=ze,Le.asYears=Ae,Le.valueOf=Kc,Le._bubble=Gc,Le.get=Mc,Le.milliseconds=Be,Le.seconds=Ce,Le.minutes=De,Le.hours=Ee,Le.days=Fe,Le.weeks=Oc,Le.months=Ge,Le.years=He,Le.humanize=Sc,Le.toISOString=Tc,Le.toString=Tc,Le.toJSON=Tc,Le.locale=ub,Le.localeData=vb,Le.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Le.lang=Zd,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",od),O("X",rd),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.11.2",b(Ea),a.fn=ke,a.min=Ga,a.max=Ha,a.now=Td,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=ke;var Me=a;return Me}),/** @license
function(a,b){"function"==typeof define&&define.amd?define(["moment"],b):"object"==typeof exports?module.exports=b(require("moment")):b(a.moment)}(this,function(a){function b(a){return a>96?a-87:a>64?a-29:a-48}function c(a){var c,d=0,e=a.split("."),f=e[0],g=e[1]||"",h=1,i=0,j=1;for(45===a.charCodeAt(0)&&(d=1,j=-1),d;d<f.length;d++)c=b(f.charCodeAt(d)),i=60*i+c;for(d=0;d<g.length;d++)h/=60,c=b(g.charCodeAt(d)),i+=c*h;returni*j}functiond(a){for(varb=0;b<a.length;b++)a[b]=c(a[b])}functione(a,b){for(varc=0;c<b;c++)a[c]=Math.round((a[c-1]||0)+6e4*a[c]);a[b-1]=1/0}functionf(a,b){varc,d=[];for(c=0;c<b.length;c++)d[c]=a[b[c]];returnd}functiong(a){varb=a.split("|"),c=b[2].split(""),g=b[3].split(""),h=b[4].split("");returnd(c),d(g),d(h),e(h,g.length),{name:b[0],abbrs:f(b[1].split(""),g),offsets:f(c,g),untils:h}}functionh(a){a&&this._set(g(a))}functioni(a){return(a||"").toLowerCase().replace(/\//g,"_")}functionj(a){varb,c,d;for("string"==typeofa&&(a=[a]),b=0;b<a.length;b++)c=a[b].split("|")[0],d=i(c),v[d]=a[b],x[d]=c}functionk(a,b){a=i(a);varc,d=v[a];returndinstanceofh?d:"string"==typeofd?(d=newh(d),v[a]=d,d):w[a]&&b!==k&&(c=k(w[a],k))?(d=v[a]=newh,d._set(c),d.name=x[a],d):null}functionl(){vara,b=[];for(ainx)x.hasOwnProperty(a)&&(v[a]||v[w[a]])&&x[a]&&b.push(x[a]);returnb.sort()}functionm(a){varb,c,d,e;for("string"==typeofa&&(a=[a]),b=0;b<a.length;b++)c=a[b].split("|"),d=i(c[0]),e=i(c[1]),w[d]=e,x[d]=c[0],w[e]=d,x[e]=c[1]}functionn(a){j(a.zones),m(a.links),r.dataVersion=a.version}functiono(a){returno.didShowError||(o.didShowError=!0,q("moment.tz.zoneExists('"+a+"')hasbeendeprecatedinfavorof!moment.tz.zone('"+a+"')")),!!k(a)}functionp(a){return!(!a._a||void0!==a._tzm)}functionq(a){"undefined"!=typeofconsole&&"function"==typeofconsole.error&&console.error(a)}functionr(b){varc=Array.prototype.slice.call(arguments,0,-1),d=arguments[arguments.length-1],e=k(d),f=a.utc.apply(null,c);returne&&!a.isMoment(b)&&p(f)&&f.add(e.parse(f),"minutes"),f.tz(d),f}functions(a){returnfunction(){returnthis._z?this._z.abbr(this):a.call(this)}}functiont(a){returnfunction(){returnthis._z=null,a.apply(this,arguments)}}if(void0!==a.tz)returnq("MomentTimezone"+a.tz.version+"wasalreadyloaded"+(a.tz.dataVersion?"withdatafrom":"withoutanydata")+a.tz.dataVersion),a;varu="0.4.1",v={},w={},x={},y=a.version.split("."),z=+y[0],A=+y[1];(z<2||2===z&&A<6)&&q("MomentTimezonerequiresMoment.js>= 2.6.0. You are using Moment.js "+a.version+". See momentjs.com"),h.prototype={_set:function(a){this.name=a.name,this.abbrs=a.abbrs,this.untils=a.untils,this.offsets=a.offsets},_index:function(a){var b,c=+a,d=this.untils;for(b=0;b<d.length;b++)if(c<d[b])returnb},parse:function(a){varb,c,d,e,f=+a,g=this.offsets,h=this.untils,i=h.length-1;for(e=0;e<i;e++)if(b=g[e],c=g[e+1],d=g[e?e-1:e],b<c&&r.moveAmbiguousForward?b=c:b>d&&r.moveInvalidForward&&(b=d),f<h[e]-6e4*b)returng[e];returng[i]},abbr:function(a){returnthis.abbrs[this._index(a)]},offset:function(a){returnthis.offsets[this._index(a)]}},r.version=u,r.dataVersion="",r._zones=v,r._links=w,r._names=x,r.add=j,r.link=m,r.load=n,r.zone=k,r.zoneExists=o,r.names=l,r.Zone=h,r.unpack=g,r.unpackBase60=c,r.needsOffset=p,r.moveInvalidForward=!0,r.moveAmbiguousForward=!1;varB=a.fn;a.tz=r,a.defaultZone=null,a.updateOffset=function(b,c){vard,e=a.defaultZone;void0===b._z&&(e&&p(b)&&!b._isUTC&&(b._d=a.utc(b._a)._d,b.utc().add(e.parse(b),"minutes")),b._z=e),b._z&&(d=b._z.offset(b),Math.abs(d)<16&&(d/=60),void0!==b.utcOffset?b.utcOffset(-d,c):b.zone(d,c))},B.tz=function(b){returnb?(this._z=k(b),this._z?a.updateOffset(this):q("MomentTimezonehasnodatafor"+b+".Seehttp://momentjs.com/timezone/docs/#/data-loading/."),this):this._z?this._z.name:void0},B.zoneName=s(B.zoneName),B.zoneAbbr=s(B.zoneAbbr),B.utc=t(B.utc),a.tz.setDefault=function(b){return(z<2||2===z&&A<9)&&q("MomentTimezonesetDefault()requiresMoment.js>= 2.9.0. You are using Moment.js "+a.version+"."),a.defaultZone=b?k(b):null,a};var C=a.momentProperties;return"[object Array]"===Object.prototype.
var c=b[0]/32,d=b[1],e=CryptoJS.enc.Hex.parse(b[2]||""),f=b[3],g=b[4],h=Utils.format[f].parse(a),i=CryptoJS.EvpKDF(h,e,{keySize:c,iterations:d});return i.toString(Utils.format[g])},run_rc4:function(a,b){var c=Utils.format[b[1]].parse(a),d=Utils.format[b[0].option].parse(b[0].string),e=CryptoJS.RC4.encrypt(c,d);return e.ciphertext.toString(Utils.format[b[2]])},RC4DROP_BYTES:768,run_rc4drop:function(a,b){var c=Utils.format[b[1]].parse(a),d=Utils.format[b[0].option].parse(b[0].string),e=b[3],f=CryptoJS.RC4Drop.encrypt(c,d,{drop:e});return f.ciphertext.toString(Utils.format[b[2]])},VIG_ENC_KEY:"cipher",run_vigenc:function(a,b){var c,d,e,f="abcdefghijklmnopqrstuvwxyz",g=b[0].toLowerCase(),h="",i=0;if(!g)throw"A keyword is required.";if(!/^[a-zA-Z]+$/.test(g))throw"Keyword can only consist of letters.";for(var j=0;j<a.length;j++)f.indexOf(a[j])>=0?(e=g[(j-i)%g.length],c=f.indexOf(e),d=f.indexOf(a[j]),h+=f[(c+d)%26]):f.indexOf(a[j].toLowerCase())>=0?(e=g[(j-i)%g.length].toLowerCase(),c=f.indexOf(e),d=f.indexOf(a[j].toLowerCase()),h+=f[(c+d)%26].toUpperCase()):(h+=a[j],i++);return h},VIG_DEC_KEY:"cipher",run_vigdec:function(a,b){var c,d,e,f="abcdefghijklmnopqrstuvwxyz",g=b[0].toLowerCase(),h="",i=0;if(!g)throw"A keyword is required.";if(!/^[a-zA-Z]+$/.test(g))throw"Keyword can only consist of letters.";for(var j=0;j<a.length;j++)f.indexOf(a[j])>=0?(e=g[(j-i)%g.length],c=f.indexOf(e),d=f.indexOf(a[j]),h+=f[(d-c+f.length)%26]):f.indexOf(a[j].toLowerCase())>=0?(e=g[(j-i)%g.length].toLowerCase(),c=f.indexOf(e),d=f.indexOf(a[j].toLowerCase()),h+=f[(d+f.length-c)%26].toUpperCase()):(h+=a[j],i++);return h}};CryptoJS.kdf.OpenSSL.execute=function(a,b,c,d){void 0!==d&&null!==d||(d=CryptoJS.lib.WordArray.random(8));var e=CryptoJS.algo.EvpKDF.create({keySize:b+c}).compute(a,d),f=CryptoJS.lib.WordArray.create(e.words.slice(b),4*c);return e.sigBytes=4*b,CryptoJS.lib.CipherParams.create({key:e,iv:f,salt:d})};var Code={LANGUAGES:["default-code","default-markup","bash","bsh","c","cc","coffee","cpp","cs","csh","cv","cxx","cyc","htm","html","in.tag","java","javascript","js","json","m","mxml","perl","pl","pm","py","python","rb","rc","rs","ruby","rust","sh","uq.val","xhtml","xml","xsl"],LINE_NUMS:!1,run_syntax_highlight:function(a,b){var c=b[0],d=b[1];return"<codeclass='prettyprint'>"+prettyPrintOne(Utils.escape_html(a),c,d)+"</code>"},BEAUTIFY_INDENT:"\\t",run_xml_beautify:function(a,b){var c=b[0];return vkbeautify.xml(a,c)},run_json_beautify:function(a,b){var c=b[0];return a?vkbeautify.json(a,c):""},run_css_beautify:function(a,b){var c=b[0];return vkbeautify.css(a,c)},run_sql_beautify:function(a,b){var c=b[0];return vkbeautify.sql(a,c)},PRESERVE_COMMENTS:!1,run_xml_minify:function(a,b){var c=b[0];return vkbeautify.xmlmin(a,c)},run_json_minify:function(a,b){return a?vkbeautify.jsonmin(a):""},run_css_minify:function(a,b){var c=b[0];return vkbeautify.cssmin(a,c)},run_sql_minify:function(a,b){return vkbeautify.sqlmin(a)},run_generic_beautify:function(a,b){function c(a,b,c){return g[c]=b[0],a.substring(0,b.index)+"###preserved_token"+c+"###"+a.substring(b.index+b[0].length)}for(var d,e=a,f=0,g=[],h=/'([^'\\]|\\.)*'/g;d=h.exec(e);)e=c(e,d,f++),h.lastIndex=d.index;for(var i=/"([^"\\]|\\.)*"/g;d=i.exec(e);)e=c(e,d,f++),i.lastIndex=d.index;for(var j=/\/\/[^\n\r]*/g;d=j.exec(e);)e=c(e,d,f++),j.lastIndex=d.index;for(var k=/\/\*[\s\S]*?\*\//gm;d=k.exec(e);)e=c(e,d,f++),k.lastIndex=d.index;for(var l=/(^|\n)#[^\n\r#]+/g;d=l.exec(e);)e=c(e,d,f++),l.lastIndex=d.index;for(var m=/\/.*?[^\\]\/[gim]{0,3}/gi;d=m.exec(e);)e=c(e,d,f++),m.lastIndex=d.index;e=e.replace(/;/g,";\n"),e=e.replace(/{/g,"{\n"),e=e.replace(/}/g,"\n}\n"),e=e.replace(/\r/g,""),e=e.replace(/^\s+/g,""),e=e.replace(/\n\s+/g,"\n"),e=e.replace(/\s*$/g,""),e=e.replace(/\n{/g,"{");for(var n=0,o=0;n<e.length;){switch(e[n]){case"{":o++;break;case"\n":if(n+1>=e.length)break;"}"==e[n+1]&&o--;var p=o>=0?Array(4*o+1).join(" "):"";e=e.substring(0,n+1)+p+e.substring(n+1),o>0&&(n+=4*o)}n++}e=e.replace(/\s*([!<>=+-\/*]?)=\s*/g," $1= "),e=e.replace(/\s*<([=]?)\s*/g," <$1 "),e=e.replace(/\s*>([=]?)\s*/g," >$1 "),e
c+=Extract.run_ip(a,[!0,!0,!1]),c+="\nEmail addresses\n",c+=Extract.run_email(a,[]),c+="\nMAC addresses\n",c+=Extract.run_mac(a,[]),c+="\nURLs\n",c+=Extract.run_urls(a,[]),c+="\nDomain names\n",c+=Extract.run_domains(a,[]),c+="\nFile paths\n",c+=Extract.run_file_paths(a,[!0,!0]),c+="\nDates\n",c+=Extract.run_dates(a,[])}},FileType={run_detect:function(a,b){var c=FileType._magic_type(a);if(c){var d="File extension: "+c.ext+"\nMIME type: "+c.mime;return c.desc&&c.desc.length&&(d+="\nDescription: "+c.desc),d}return"Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?"},IGNORE_COMMON_BYTE_SEQUENCES:!0,run_scan_for_embedded_files:function(a,b){for(var c,d="Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any suffiently long file is likely to contain these magic bytes coincidentally.\n",e=b[0],f=["ico","ttf",""],g=0,h=0,i=0;i<a.length;i++)if(c=FileType._magic_type(a.slice(i))){if(e&&f.indexOf(c.ext)>-1){h++;continue}g++,d+="\nOffset "+i+" (0x"+Utils.hex(i)+"):\n File extension: "+c.ext+"\n MIME type: "+c.mime+"\n",c.desc&&c.desc.length&&(d+=" Description: "+c.desc+"\n")}return 0===g&&(d+="\nNo embedded files were found."),h>0&&(d+="\n\n"+h,d+=1==h?" file type was detected that has a common byte sequence. This is likely to be a false positive.":" file types were detected that have common byte sequences. These are likely to be false positives.",d+=" Run this operation with the 'Ignore common byte sequences' option unchecked to see details."),d},_magic_type:function(a){return a&&a.length>1?255===a[0]&&216===a[1]&&255===a[2]?{ext:"jpg",mime:"image/jpeg"}:137===a[0]&&80===a[1]&&78===a[2]&&71===a[3]?{ext:"png",mime:"image/png"}:71===a[0]&&73===a[1]&&70===a[2]?{ext:"gif",mime:"image/gif"}:87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]?{ext:"webp",mime:"image/webp"}:(73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3])&&67===a[8]&&82===a[9]?{ext:"cr2",mime:"image/x-canon-cr2"}:73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3]?{ext:"tif",mime:"image/tiff"}:66===a[0]&&77===a[1]?{ext:"bmp",mime:"image/bmp"}:73===a[0]&&73===a[1]&&188===a[2]?{ext:"jxr",mime:"image/vnd.ms-photo"}:56===a[0]&&66===a[1]&&80===a[2]&&83===a[3]?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:80===a[0]&&75===a[1]&&3===a[2]&&4===a[3]&&109===a[30]&&105===a[31]&&109===a[32]&&101===a[33]&&116===a[34]&&121===a[35]&&112===a[36]&&101===a[37]&&97===a[38]&&112===a[39]&&112===a[40]&&108===a[41]&&105===a[42]&&99===a[43]&&97===a[44]&&116===a[45]&&105===a[46]&&111===a[47]&&110===a[48]&&47===a[49]&&101===a[50]&&112===a[51]&&117===a[52]&&98===a[53]&&43===a[54]&&122===a[55]&&105===a[56]&&112===a[57]?{ext:"epub",mime:"application/epub+zip"}:80!==a[0]||75!==a[1]||3!==a[2]&&5!==a[2]&&7!==a[2]||4!==a[3]&&6!==a[3]&&8!==a[3]?117===a[257]&&115===a[258]&&116===a[259]&&97===a[260]&&114===a[261]?{ext:"tar",mime:"application/x-tar"}:82!==a[0]||97!==a[1]||114!==a[2]||33!==a[3]||26!==a[4]||7!==a[5]||0!==a[6]&&1!==a[6]?31===a[0]&&139===a[1]&&8===a[2]?{ext:"gz",mime:"application/gzip"}:66===a[0]&&90===a[1]&&104===a[2]?{ext:"bz2",mime:"application/x-bzip2"}:55===a[0]&&122===a[1]&&188===a[2]&&175===a[3]&&39===a[4]&&28===a[5]?{ext:"7z",mime:"application/x-7z-compressed"}:120===a[0]&&1===a[1]?{ext:"dmg",mime:"application/x-apple-diskimage"}:0===a[0]&&0===a[1]&&0===a[2]&&(24===a[3]||32===a[3])&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]||51===a[0]&&103===a[1]&&112===a[2]&&53===a[3]||0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&109===a[8]&&112===a[9]&&52===a[10]&&50===a[11]&&109===a[16]&&112===a[17]&&52===a[18]&&49===a[19]&&109===a[20]&&112===a[21]&&52===a[22]&&50===a[23]&&105===a[24]&&115===a[25]&&111===a[26]&&109===a[27]?{ext:"mp4",mime:"video/mp4"}:0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&77===a[8]&&52===a[9]&&86===a[10]?{ext:"m4v",mime:"video/x-m4v"}:
}for(n in i)if(i[n]=i[n].sort(),l+=IP._ipv4_to_str(n)+"/"+d+"\n",!e){for(p=0;p<i[n].length;p++)l+=""+IP._ipv4_to_str(i[n][p])+"\n";l+="\n"}for(oinj)if(l+=o+"/"+d+"\n",!e){for(p=0;p<j[o].length;p++)l+=""+IP._ipv6_to_str(j[o][p],!0)+"\n";l+="\n"}returnl},_LARGE_RANGE_ERROR:'Thespecifiedrangecontainsmorethan65,536addresses.Runningthisquerycouldcrashyourbrowser.Ifyouwanttorunit,selectthe"Allowlargequeries"option.Youareadvisedtoturnoff"AutoBake"whilsteditinglargeranges.',_ipv4_cidr_range:function(a,b,c,d){vare="",f=IP._str_to_ipv4(a[1]),g=parseInt(a[2],10);if(g<0||g>31)return"IPv4 CIDR must be less than 32";var h=~(4294967295>>>g),i=f&h,j=i|~h;return b&&(e+="Network: "+IP._ipv4_to_str(f)+"\n",e+="CIDR: "+g+"\n",e+="Mask: "+IP._ipv4_to_str(h)+"\n",e+="Range: "+IP._ipv4_to_str(i)+" - "+IP._ipv4_to_str(j)+"\n",e+="Total addresses in range: "+((j-i>>>0)+1)+"\n\n"),c&&(e+=g>=16||d?IP._generate_ipv4_range(i,j).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6_cidr_range:function(a,b){var c="",d=IP._str_to_ipv6(a[1]),e=parseInt(a[a.length-1],10);if(e<0||e>127)return"IPv6 CIDR must be less than 128";for(var f=IP._gen_ipv6_mask(e),g=new Array(8),h=new Array(8),i="",j=new Array(128),k=0;k<8;k++)if(g[k]=d[k]&f[k],h[k]=g[k]|65535&~f[k],i=(h[k]-g[k]).toString(2),"0"!=i)for(varl=0;l<i.length;l++)j[16*k+16-(i.length-l)]=i[l];returnb&&(c+="Network:"+IP._ipv6_to_str(d)+"\n",c+="Shorthand:"+IP._ipv6_to_str(d,!0)+"\n",c+="CIDR:"+e+"\n",c+="Mask:"+IP._ipv6_to_str(f)+"\n",c+="Range:"+IP._ipv6_to_str(g)+"-"+IP._ipv6_to_str(h)+"\n",c+="Totaladdressesinrange:"+(parseInt(j.join(""),2)+1)+"\n\n"),c},_gen_ipv6_mask:function(a){for(varb,c=newArray(8),d=0;d<8;d++)a>16*(d+1)?c[d]=65535:(b=a-16*d,b<0&&(b=0),c[d]=~(65535>>>b|4294901760));return c},_ipv4_hyphenated_range:function(a,b,c,d){for(var e="",f=IP._str_to_ipv4(a[1]),g=IP._str_to_ipv4(a[2]),h=f^g,i=32,j=0;0!==h;)h>>=1,i--,j=j<<1|1;j=~j>>>0;var k=f&j,l=k&j,m=l|~j;return b&&(e+="Minimum subnet required to hold this range:\n",e+="\tNetwork: "+IP._ipv4_to_str(k)+"\n",e+="\tCIDR: "+i+"\n",e+="\tMask: "+IP._ipv4_to_str(j)+"\n",e+="\tSubnet range: "+IP._ipv4_to_str(l)+" - "+IP._ipv4_to_str(m)+"\n",e+="\tTotal addresses in subnet: "+((m-l>>>0)+1)+"\n\n",e+="Range: "+IP._ipv4_to_str(f)+" - "+IP._ipv4_to_str(g)+"\n",e+="Total addresses in range: "+((g-f>>>0)+1)+"\n\n"),c&&(e+=g-f>>>0<=65536||d?IP._generate_ipv4_range(f,g).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6_hyphenated_range:function(a,b){for(var c="",d=IP._str_to_ipv6(a[1]),e=IP._str_to_ipv6(a[14]),f="",g=new Array(128),h=0;h<128;h++)g[h]="0";for(h=0;h<8;h++)if(f=(e[h]-d[h]).toString(2),"0"!=f)for(vari=0;i<f.length;i++)g[16*h+16-(f.length-i)]=f[i];returnb&&(c+="Range:"+IP._ipv6_to_str(d)+"-"+IP._ipv6_to_str(e)+"\n",c+="Shorthandrange:"+IP._ipv6_to_str(d,!0)+"-"+IP._ipv6_to_str(e,!0)+"\n",c+="Totaladdressesinrange:"+(parseInt(g.join(""),2)+1)+"\n\n"),c},_str_to_ipv4:function(a){functionb(a){if(4!=a.length)throw"Morethan4blocks.";for(varb=[],c=0;c<4;c++)if(b[c]=parseInt(a[c],10),b[c]<0||b[c]>255)throw"Block out of range.";return b}var c=a.split("."),d=b(c),e=0;return e+=d[0]<<24,e+=d[1]<<16,e+=d[2]<<8,e+=d[3]},_ipv4_to_str:function(a){varb=a>>24&255,c=a>>16&255,d=a>>8&255,e=255&a;return b+"."+c+"."+d+"."+e},_str_to_ipv6:function(a){function b(a){if(a.length<3||a.length>8)throw"Badly formatted IPv6 address.";for(var b=[],c=0;c<a.length;c++)if(b[c]=parseInt(a[c],16),b[c]<0||b[c]>65535)throw"Block out of range.";return b}for(var c=a.split(":"),d=b(c),e=0,f=new Array(8),g=0;g<8;g++)isNaN(d[e])?(f[g]=0,g==8-d.slice(e).length&&e++):(f[g]=d[e],e++);returnf},_ipv6_to_str:function(a,b){varc="",d=0;if(b){vare=-1,f=-1,g=0,h=-1;for(d=0;d<8;d++)0===a[d]&&h===d-1?h=d:0===a[d]&&(g=d,h=d),h>=0&&h-g>f-e&&(e=g,f=h);for(d=0;d<8;d++)d!=e?c+=Utils.hex(a[d],1)+":":(c+=":",d=f,7===f&&(c+=":"));":"===c[0]&&(c=":"+c)}elsefor(d=0;d<8;d++)c+=Utils.hex(a[d],4)+":";returnc.slice(0,c.length-1)},_generate_ipv4_range:function(a,b){varc=[];if(b>=a)for(;a<=b;a++)c.push(IP._ipv4_to_str(a));else c[0]="Second IP
},{name:"Date / Time",ops:["Parse DateTime","Translate DateTime Format","From UNIX Timestamp","To UNIX Timestamp","Extract dates"]},{name:"Extractors",ops:["Strings","Extract IP addresses","Extract email addresses","Extract MAC addresses","Extract URLs","Extract domains","Extract file paths","Extract dates","Regular expression"]},{name:"Compression",ops:["Raw Deflate","Raw Inflate","Zlib Deflate","Zlib Inflate","Gzip","Gunzip","Zip","Unzip","Bzip2 Decompress"]},{name:"Hashing",ops:["Analyse hash","Generate all hashes","MD5","SHA1","SHA224","SHA256","SHA384","SHA512","SHA3","RIPEMD-160","HMAC","Fletcher-16 Checksum","Adler-32 Checksum","CRC-32 Checksum","TCP/IP Checksum"]},{name:"Code tidy",ops:["Syntax highlighter","Generic Code Beautify","JavaScript Parser","JavaScript Beautify","JavaScript Minify","JSON Beautify","JSON Minify","XML Beautify","XML Minify","SQL Beautify","SQL Minify","CSS Beautify","CSS Minify","Strip HTML tags","Diff"]},{name:"Other",ops:["Entropy","Frequency distribution","Detect File Type","Scan for Embedded Files","Generate UUID","Numberwang"]},{name:"Flow control",ops:["Fork","Merge","Jump","Conditional Jump","Return"]}],OperationConfig={Fork:{description:"Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.<br><br>For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.",run:FlowControl.run_fork,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Split delimiter",type:"binary_short_string",value:FlowControl.FORK_DELIM},{name:"Merge delimiter",type:"binary_short_string",value:FlowControl.MERGE_DELIM}]},Merge:{description:"Consolidate all branches back into a single trunk. The opposite of Fork.",run:FlowControl.run_merge,input_type:"string",output_type:"string",flow_control:!0,args:[]},Jump:{description:"Jump forwards or backwards over the specified number of operations.",run:FlowControl.run_jump,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Number of operations to jump over",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},"Conditional Jump":{description:"Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.",run:FlowControl.run_cond_jump,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Match (regex)",type:"string",value:""},{name:"Number of operations to jump over if match found",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},Return:{description:"End execution of operations at this point in the recipe.",run:FlowControl.run_return,input_type:"string",output_type:"string",flow_control:!0,args:[]},"From Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation decodes data from an ASCII Base64 string back into its raw format.<br><br>e.g. <code>aGVsbG8=</code> becomes <code>hello</code>",run:Base64.run_from,highlight:Base64.highlight_from,highlight_reverse:Base64.highlight_to,input_type:"string",output_type:"byte_array",args:[{name:"Alphabet",type:"editable_option",value:Base64.ALPHABET_OPTIONS},{name:"Remove non‑alphabet chars",type:"boolean",value:Base64.REMOVE_NON_ALPH_CHARS}]},"To Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation encodes data in an ASCII Base64 string.<br><br>e.g. <code>hello</code> becomes <code>aGVsbG8=</code>",run:Base64.run_to,highlight:Base64.highlight_to,highlight_reverse:Base64.highlight_from,input_type:"byte_array",output_type:"string",args:[{name:"Alphabet",type:"editabl
name:"Amount",type:"number",value:Rotate.ROT47_AMOUNT}]},"Strip HTTP headers":{description:"Removes HTTP headers from a request or response by looking for the first instance of a double newline.",run:HTTP.run_strip_headers,input_type:"string",output_type:"string",args:[]},"Parse User Agent":{description:"Attempts to identify and categorise information contained in a user-agent string.",run:HTTP.run_parse_user_agent,input_type:"string",output_type:"string",args:[]},"Format MAC addresses":{description:"Displays given MAC addresses in multiple different formats.<br><br>Expects addresses in a list separated by newlines, spaces or commas.<br><br>WARNING: There are no validity checks.",run:MAC.run_format,input_type:"string",output_type:"string",args:[{name:"Output case",type:"option",value:MAC.OUTPUT_CASE},{name:"No delimiter",type:"boolean",value:MAC.NO_DELIM},{name:"Dash delimiter",type:"boolean",value:MAC.DASH_DELIM},{name:"Colon delimiter",type:"boolean",value:MAC.COLON_DELIM},{name:"Cisco style",type:"boolean",value:MAC.CISCO_STYLE}]},"Offset checker":{description:"Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.",run:StrUtils.run_offset_checker,input_type:"string",output_type:"html",args:[{name:"Sample delimiter",type:"binary_string",value:StrUtils.OFF_CHK_SAMPLE_DELIMITER}]},"Remove whitespace":{description:"Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.<br><br>This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.",run:Tidy.run_remove_whitespace,input_type:"string",output_type:"string",args:[{name:"Spaces",type:"boolean",value:Tidy.REMOVE_SPACES},{name:"Carriage returns (\\r)",type:"boolean",value:Tidy.REMOVE_CARIAGE_RETURNS},{name:"Line feeds (\\n)",type:"boolean",value:Tidy.REMOVE_LINE_FEEDS},{name:"Tabs",type:"boolean",value:Tidy.REMOVE_TABS},{name:"Form feeds (\\f)",type:"boolean",value:Tidy.REMOVE_FORM_FEEDS},{name:"Full stops",type:"boolean",value:Tidy.REMOVE_FULL_STOPS}]},"Remove null bytes":{description:"Removes all null bytes (<code>0x00</code>) from the input.",run:Tidy.run_remove_nulls,input_type:"byte_array",output_type:"byte_array",args:[]},"Drop bytes":{description:"Cuts the specified number of bytes out of the data.",run:Tidy.run_drop_bytes,input_type:"byte_array",output_type:"byte_array",args:[{name:"Start",type:"number",value:Tidy.DROP_START},{name:"Length",type:"number",value:Tidy.DROP_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Take bytes":{description:"Takes a slice of the specified number of bytes from the data.",run:Tidy.run_take_bytes,input_type:"byte_array",output_type:"byte_array",args:[{name:"Start",type:"number",value:Tidy.TAKE_START},{name:"Length",type:"number",value:Tidy.TAKE_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Pad lines":{description:"Add the specified number of the specified character to the beginning or end of each line",run:Tidy.run_pad,input_type:"string",output_type:"string",args:[{name:"Position",type:"option",value:Tidy.PAD_POSITION},{name:"Length",type:"number",value:Tidy.PAD_LENGTH},{name:"Character",type:"binary_short_string",value:Tidy.PAD_CHAR}]},Reverse:{description:"Reverses the input string.",run:SeqUtils.run_reverse,input_type:"byte_array",output_type:"byte_array",args:[{name:"By",type:"option",value:SeqUtils.REVERSE_BY}]},Sort:{description:"Alphabetically sorts strings separated by the specified delimiter.<br><br>The IP address option supports IPv4 only.",run:SeqUtils.run_sort,input_type:"string",output_type:"string",args:[{name:"Delimiter",type:"option",value:SeqUtils.DELIMITER_OPTIONS},{name:"Reverse",type:"boolean",value:SeqUtils.SORT_REVERSE},{name:"Order",type:"option",value:SeqUtils.SORT_ORDER}]},Unique:{description:"Removes duplicate strings from the input.",run:SeqUtils.run_unique,input_type:"string",output_type:"string",args:[{name:"Delimiter",type:"
var c=b[0]/32,d=b[1],e=CryptoJS.enc.Hex.parse(b[2]||""),f=b[3],g=b[4],h=Utils.format[f].parse(a),i=CryptoJS.EvpKDF(h,e,{keySize:c,iterations:d});return i.toString(Utils.format[g])},run_rc4:function(a,b){var c=Utils.format[b[1]].parse(a),d=Utils.format[b[0].option].parse(b[0].string),e=CryptoJS.RC4.encrypt(c,d);return e.ciphertext.toString(Utils.format[b[2]])},RC4DROP_BYTES:768,run_rc4drop:function(a,b){var c=Utils.format[b[1]].parse(a),d=Utils.format[b[0].option].parse(b[0].string),e=b[3],f=CryptoJS.RC4Drop.encrypt(c,d,{drop:e});return f.ciphertext.toString(Utils.format[b[2]])},run_vigenere_enc:function(a,b){var c,d,e,f="abcdefghijklmnopqrstuvwxyz",g=b[0].toLowerCase(),h="",i=0;if(!g)return"No key entered";if(!/^[a-zA-Z]+$/.test(g))return"The key must consist only of letters";for(var j=0;j<a.length;j++)f.indexOf(a[j])>=0?(e=g[(j-i)%g.length],c=f.indexOf(e),d=f.indexOf(a[j]),h+=f[(c+d)%26]):f.indexOf(a[j].toLowerCase())>=0?(e=g[(j-i)%g.length].toLowerCase(),c=f.indexOf(e),d=f.indexOf(a[j].toLowerCase()),h+=f[(c+d)%26].toUpperCase()):(h+=a[j],i++);return h},run_vigenere_dec:function(a,b){var c,d,e,f="abcdefghijklmnopqrstuvwxyz",g=b[0].toLowerCase(),h="",i=0;if(!g)return"No key entered";if(!/^[a-zA-Z]+$/.test(g))return"The key must consist only of letters";for(var j=0;j<a.length;j++)f.indexOf(a[j])>=0?(e=g[(j-i)%g.length],c=f.indexOf(e),d=f.indexOf(a[j]),h+=f[(d-c+f.length)%26]):f.indexOf(a[j].toLowerCase())>=0?(e=g[(j-i)%g.length].toLowerCase(),c=f.indexOf(e),d=f.indexOf(a[j].toLowerCase()),h+=f[(d+f.length-c)%26].toUpperCase()):(h+=a[j],i++);return h}};CryptoJS.kdf.OpenSSL.execute=function(a,b,c,d){void 0!==d&&null!==d||(d=CryptoJS.lib.WordArray.random(8));var e=CryptoJS.algo.EvpKDF.create({keySize:b+c}).compute(a,d),f=CryptoJS.lib.WordArray.create(e.words.slice(b),4*c);return e.sigBytes=4*b,CryptoJS.lib.CipherParams.create({key:e,iv:f,salt:d})};var Code={LANGUAGES:["default-code","default-markup","bash","bsh","c","cc","coffee","cpp","cs","csh","cv","cxx","cyc","htm","html","in.tag","java","javascript","js","json","m","mxml","perl","pl","pm","py","python","rb","rc","rs","ruby","rust","sh","uq.val","xhtml","xml","xsl"],LINE_NUMS:!1,run_syntax_highlight:function(a,b){var c=b[0],d=b[1];return"<codeclass='prettyprint'>"+prettyPrintOne(Utils.escape_html(a),c,d)+"</code>"},BEAUTIFY_INDENT:"\\t",run_xml_beautify:function(a,b){var c=b[0];return vkbeautify.xml(a,c)},run_json_beautify:function(a,b){var c=b[0];return a?vkbeautify.json(a,c):""},run_css_beautify:function(a,b){var c=b[0];return vkbeautify.css(a,c)},run_sql_beautify:function(a,b){var c=b[0];return vkbeautify.sql(a,c)},PRESERVE_COMMENTS:!1,run_xml_minify:function(a,b){var c=b[0];return vkbeautify.xmlmin(a,c)},run_json_minify:function(a,b){return a?vkbeautify.jsonmin(a):""},run_css_minify:function(a,b){var c=b[0];return vkbeautify.cssmin(a,c)},run_sql_minify:function(a,b){return vkbeautify.sqlmin(a)},run_generic_beautify:function(a,b){function c(a,b,c){return g[c]=b[0],a.substring(0,b.index)+"###preserved_token"+c+"###"+a.substring(b.index+b[0].length)}for(var d,e=a,f=0,g=[],h=/'([^'\\]|\\.)*'/g;d=h.exec(e);)e=c(e,d,f++),h.lastIndex=d.index;for(var i=/"([^"\\]|\\.)*"/g;d=i.exec(e);)e=c(e,d,f++),i.lastIndex=d.index;for(var j=/\/\/[^\n\r]*/g;d=j.exec(e);)e=c(e,d,f++),j.lastIndex=d.index;for(var k=/\/\*[\s\S]*?\*\//gm;d=k.exec(e);)e=c(e,d,f++),k.lastIndex=d.index;for(var l=/(^|\n)#[^\n\r#]+/g;d=l.exec(e);)e=c(e,d,f++),l.lastIndex=d.index;for(var m=/\/.*?[^\\]\/[gim]{0,3}/gi;d=m.exec(e);)e=c(e,d,f++),m.lastIndex=d.index;e=e.replace(/;/g,";\n"),e=e.replace(/{/g,"{\n"),e=e.replace(/}/g,"\n}\n"),e=e.replace(/\r/g,""),e=e.replace(/^\s+/g,""),e=e.replace(/\n\s+/g,"\n"),e=e.replace(/\s*$/g,""),e=e.replace(/\n{/g,"{");for(var n=0,o=0;n<e.length;){switch(e[n]){case"{":o++;break;case"\n":if(n+1>=e.length)break;"}"==e[n+1]&&o--;var p=o>=0?Array(4*o+1).join(" "):"";e=e.substring(0,n+1)+p+e.substring(n+1),o>0&&(n+=4*o)}n++}e=e.replace(/\s*([!<>=+-\/*]?)=\s*/g," $1= "),e=e.replace(/\s*<([=]?)\s*/g," <$1 "),e=e.replace(/\s*>([=]?)\s*/g," >$1 "),e=e.replace(/([^+])\+([^+=])/g,"$1 + $2"),e
c+=Extract.run_email(a,[]),c+="\nMAC addresses\n",c+=Extract.run_mac(a,[]),c+="\nURLs\n",c+=Extract.run_urls(a,[]),c+="\nDomain names\n",c+=Extract.run_domains(a,[]),c+="\nFile paths\n",c+=Extract.run_file_paths(a,[!0,!0]),c+="\nDates\n",c+=Extract.run_dates(a,[])}},FileType={run_detect:function(a,b){var c=FileType._magic_type(a);if(c){var d="File extension: "+c.ext+"\nMIME type: "+c.mime;return c.desc&&c.desc.length&&(d+="\nDescription: "+c.desc),d}return"Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?"},IGNORE_COMMON_BYTE_SEQUENCES:!0,run_scan_for_embedded_files:function(a,b){for(var c,d="Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any suffiently long file is likely to contain these magic bytes coincidentally.\n",e=b[0],f=["ico","ttf",""],g=0,h=0,i=0;i<a.length;i++)if(c=FileType._magic_type(a.slice(i))){if(e&&f.indexOf(c.ext)>-1){h++;continue}g++,d+="\nOffset "+i+" (0x"+Utils.hex(i)+"):\n File extension: "+c.ext+"\n MIME type: "+c.mime+"\n",c.desc&&c.desc.length&&(d+=" Description: "+c.desc+"\n")}return 0===g&&(d+="\nNo embedded files were found."),h>0&&(d+="\n\n"+h,d+=1==h?" file type was detected that has a common byte sequence. This is likely to be a false positive.":" file types were detected that have common byte sequences. These are likely to be false positives.",d+=" Run this operation with the 'Ignore common byte sequences' option unchecked to see details."),d},_magic_type:function(a){return a&&a.length>1?255===a[0]&&216===a[1]&&255===a[2]?{ext:"jpg",mime:"image/jpeg"}:137===a[0]&&80===a[1]&&78===a[2]&&71===a[3]?{ext:"png",mime:"image/png"}:71===a[0]&&73===a[1]&&70===a[2]?{ext:"gif",mime:"image/gif"}:87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]?{ext:"webp",mime:"image/webp"}:(73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3])&&67===a[8]&&82===a[9]?{ext:"cr2",mime:"image/x-canon-cr2"}:73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3]?{ext:"tif",mime:"image/tiff"}:66===a[0]&&77===a[1]?{ext:"bmp",mime:"image/bmp"}:73===a[0]&&73===a[1]&&188===a[2]?{ext:"jxr",mime:"image/vnd.ms-photo"}:56===a[0]&&66===a[1]&&80===a[2]&&83===a[3]?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:80===a[0]&&75===a[1]&&3===a[2]&&4===a[3]&&109===a[30]&&105===a[31]&&109===a[32]&&101===a[33]&&116===a[34]&&121===a[35]&&112===a[36]&&101===a[37]&&97===a[38]&&112===a[39]&&112===a[40]&&108===a[41]&&105===a[42]&&99===a[43]&&97===a[44]&&116===a[45]&&105===a[46]&&111===a[47]&&110===a[48]&&47===a[49]&&101===a[50]&&112===a[51]&&117===a[52]&&98===a[53]&&43===a[54]&&122===a[55]&&105===a[56]&&112===a[57]?{ext:"epub",mime:"application/epub+zip"}:80!==a[0]||75!==a[1]||3!==a[2]&&5!==a[2]&&7!==a[2]||4!==a[3]&&6!==a[3]&&8!==a[3]?117===a[257]&&115===a[258]&&116===a[259]&&97===a[260]&&114===a[261]?{ext:"tar",mime:"application/x-tar"}:82!==a[0]||97!==a[1]||114!==a[2]||33!==a[3]||26!==a[4]||7!==a[5]||0!==a[6]&&1!==a[6]?31===a[0]&&139===a[1]&&8===a[2]?{ext:"gz",mime:"application/gzip"}:66===a[0]&&90===a[1]&&104===a[2]?{ext:"bz2",mime:"application/x-bzip2"}:55===a[0]&&122===a[1]&&188===a[2]&&175===a[3]&&39===a[4]&&28===a[5]?{ext:"7z",mime:"application/x-7z-compressed"}:120===a[0]&&1===a[1]?{ext:"dmg",mime:"application/x-apple-diskimage"}:0===a[0]&&0===a[1]&&0===a[2]&&(24===a[3]||32===a[3])&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]||51===a[0]&&103===a[1]&&112===a[2]&&53===a[3]||0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&109===a[8]&&112===a[9]&&52===a[10]&&50===a[11]&&109===a[16]&&112===a[17]&&52===a[18]&&49===a[19]&&109===a[20]&&112===a[21]&&52===a[22]&&50===a[23]&&105===a[24]&&115===a[25]&&111===a[26]&&109===a[27]?{ext:"mp4",mime:"video/mp4"}:0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&77===a[8]&&52===a[9]&&86===a[10]?{ext:"m4v",mime:"video/x-m4v"}:77===a[0]&&84===a[1]&&104===a[2]&&100===a[3]?{ext:"mid",m
!e){for(p=0;p<i[n].length;p++)l+=""+IP._ipv4_to_str(i[n][p])+"\n";l+="\n"}for(oinj)if(l+=o+"/"+d+"\n",!e){for(p=0;p<j[o].length;p++)l+=""+IP._ipv6_to_str(j[o][p],!0)+"\n";l+="\n"}returnl},_LARGE_RANGE_ERROR:'Thespecifiedrangecontainsmorethan65,536addresses.Runningthisquerycouldcrashyourbrowser.Ifyouwanttorunit,selectthe"Allowlargequeries"option.Youareadvisedtoturnoff"AutoBake"whilsteditinglargeranges.',_ipv4_cidr_range:function(a,b,c,d){vare="",f=IP._str_to_ipv4(a[1]),g=parseInt(a[2],10);if(g<0||g>31)return"IPv4 CIDR must be less than 32";var h=~(4294967295>>>g),i=f&h,j=i|~h;return b&&(e+="Network: "+IP._ipv4_to_str(f)+"\n",e+="CIDR: "+g+"\n",e+="Mask: "+IP._ipv4_to_str(h)+"\n",e+="Range: "+IP._ipv4_to_str(i)+" - "+IP._ipv4_to_str(j)+"\n",e+="Total addresses in range: "+((j-i>>>0)+1)+"\n\n"),c&&(e+=g>=16||d?IP._generate_ipv4_range(i,j).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6_cidr_range:function(a,b){var c="",d=IP._str_to_ipv6(a[1]),e=parseInt(a[a.length-1],10);if(e<0||e>127)return"IPv6 CIDR must be less than 128";for(var f=IP._gen_ipv6_mask(e),g=new Array(8),h=new Array(8),i="",j=new Array(128),k=0;k<8;k++)if(g[k]=d[k]&f[k],h[k]=g[k]|65535&~f[k],i=(h[k]-g[k]).toString(2),"0"!=i)for(varl=0;l<i.length;l++)j[16*k+16-(i.length-l)]=i[l];returnb&&(c+="Network:"+IP._ipv6_to_str(d)+"\n",c+="Shorthand:"+IP._ipv6_to_str(d,!0)+"\n",c+="CIDR:"+e+"\n",c+="Mask:"+IP._ipv6_to_str(f)+"\n",c+="Range:"+IP._ipv6_to_str(g)+"-"+IP._ipv6_to_str(h)+"\n",c+="Totaladdressesinrange:"+(parseInt(j.join(""),2)+1)+"\n\n"),c},_gen_ipv6_mask:function(a){for(varb,c=newArray(8),d=0;d<8;d++)a>16*(d+1)?c[d]=65535:(b=a-16*d,b<0&&(b=0),c[d]=~(65535>>>b|4294901760));return c},_ipv4_hyphenated_range:function(a,b,c,d){for(var e="",f=IP._str_to_ipv4(a[1]),g=IP._str_to_ipv4(a[2]),h=f^g,i=32,j=0;0!==h;)h>>=1,i--,j=j<<1|1;j=~j>>>0;var k=f&j,l=k&j,m=l|~j;return b&&(e+="Minimum subnet required to hold this range:\n",e+="\tNetwork: "+IP._ipv4_to_str(k)+"\n",e+="\tCIDR: "+i+"\n",e+="\tMask: "+IP._ipv4_to_str(j)+"\n",e+="\tSubnet range: "+IP._ipv4_to_str(l)+" - "+IP._ipv4_to_str(m)+"\n",e+="\tTotal addresses in subnet: "+((m-l>>>0)+1)+"\n\n",e+="Range: "+IP._ipv4_to_str(f)+" - "+IP._ipv4_to_str(g)+"\n",e+="Total addresses in range: "+((g-f>>>0)+1)+"\n\n"),c&&(e+=g-f>>>0<=65536||d?IP._generate_ipv4_range(f,g).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6_hyphenated_range:function(a,b){for(var c="",d=IP._str_to_ipv6(a[1]),e=IP._str_to_ipv6(a[14]),f="",g=new Array(128),h=0;h<128;h++)g[h]="0";for(h=0;h<8;h++)if(f=(e[h]-d[h]).toString(2),"0"!=f)for(vari=0;i<f.length;i++)g[16*h+16-(f.length-i)]=f[i];returnb&&(c+="Range:"+IP._ipv6_to_str(d)+"-"+IP._ipv6_to_str(e)+"\n",c+="Shorthandrange:"+IP._ipv6_to_str(d,!0)+"-"+IP._ipv6_to_str(e,!0)+"\n",c+="Totaladdressesinrange:"+(parseInt(g.join(""),2)+1)+"\n\n"),c},_str_to_ipv4:function(a){functionb(a){if(4!=a.length)throw"Morethan4blocks.";for(varb=[],c=0;c<4;c++)if(b[c]=parseInt(a[c],10),b[c]<0||b[c]>255)throw"Block out of range.";return b}var c=a.split("."),d=b(c),e=0;return e+=d[0]<<24,e+=d[1]<<16,e+=d[2]<<8,e+=d[3]},_ipv4_to_str:function(a){varb=a>>24&255,c=a>>16&255,d=a>>8&255,e=255&a;return b+"."+c+"."+d+"."+e},_str_to_ipv6:function(a){function b(a){if(a.length<3||a.length>8)throw"Badly formatted IPv6 address.";for(var b=[],c=0;c<a.length;c++)if(b[c]=parseInt(a[c],16),b[c]<0||b[c]>65535)throw"Block out of range.";return b}for(var c=a.split(":"),d=b(c),e=0,f=new Array(8),g=0;g<8;g++)isNaN(d[e])?(f[g]=0,g==8-d.slice(e).length&&e++):(f[g]=d[e],e++);returnf},_ipv6_to_str:function(a,b){varc="",d=0;if(b){vare=-1,f=-1,g=0,h=-1;for(d=0;d<8;d++)0===a[d]&&h===d-1?h=d:0===a[d]&&(g=d,h=d),h>=0&&h-g>f-e&&(e=g,f=h);for(d=0;d<8;d++)d!=e?c+=Utils.hex(a[d],1)+":":(c+=":",d=f,7===f&&(c+=":"));":"===c[0]&&(c=":"+c)}elsefor(d=0;d<8;d++)c+=Utils.hex(a[d],4)+":";returnc.slice(0,c.length-1)},_generate_ipv4_range:function(a,b){varc=[];if(b>=a)for(;a<=b;a++)c.push(IP._ipv4_to_str(a));else c[0]="Second IP address smaller than first.";return c}},JS={PARSE_LOC:!1,PARSE_RA
},{name:"Date / Time",ops:["Parse DateTime","Translate DateTime Format","From UNIX Timestamp","To UNIX Timestamp","Extract dates"]},{name:"Extractors",ops:["Strings","Extract IP addresses","Extract email addresses","Extract MAC addresses","Extract URLs","Extract domains","Extract file paths","Extract dates","Regular expression"]},{name:"Compression",ops:["Raw Deflate","Raw Inflate","Zlib Deflate","Zlib Inflate","Gzip","Gunzip","Zip","Unzip","Bzip2 Decompress"]},{name:"Hashing",ops:["Analyse hash","Generate all hashes","MD5","SHA1","SHA224","SHA256","SHA384","SHA512","SHA3","RIPEMD-160","HMAC","Fletcher-16 Checksum","Adler-32 Checksum","CRC-32 Checksum","TCP/IP Checksum"]},{name:"Code tidy",ops:["Syntax highlighter","Generic Code Beautify","JavaScript Parser","JavaScript Beautify","JavaScript Minify","JSON Beautify","JSON Minify","XML Beautify","XML Minify","SQL Beautify","SQL Minify","CSS Beautify","CSS Minify","Strip HTML tags","Diff"]},{name:"Other",ops:["Entropy","Frequency distribution","Detect File Type","Scan for Embedded Files","Generate UUID","Numberwang"]},{name:"Flow control",ops:["Fork","Merge","Jump","Conditional Jump","Return"]}],OperationConfig={Fork:{description:"Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.<br><br>For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.",run:FlowControl.run_fork,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Split delimiter",type:"binary_short_string",value:FlowControl.FORK_DELIM},{name:"Merge delimiter",type:"binary_short_string",value:FlowControl.MERGE_DELIM}]},Merge:{description:"Consolidate all branches back into a single trunk. The opposite of Fork.",run:FlowControl.run_merge,input_type:"string",output_type:"string",flow_control:!0,args:[]},Jump:{description:"Jump forwards or backwards over the specified number of operations.",run:FlowControl.run_jump,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Number of operations to jump over",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},"Conditional Jump":{description:"Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.",run:FlowControl.run_cond_jump,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Match (regex)",type:"string",value:""},{name:"Number of operations to jump over if match found",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},Return:{description:"End execution of operations at this point in the recipe.",run:FlowControl.run_return,input_type:"string",output_type:"string",flow_control:!0,args:[]},"From Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation decodes data from an ASCII Base64 string back into its raw format.<br><br>e.g. <code>aGVsbG8=</code> becomes <code>hello</code>",run:Base64.run_from,highlight:Base64.highlight_from,highlight_reverse:Base64.highlight_to,input_type:"string",output_type:"byte_array",args:[{name:"Alphabet",type:"editable_option",value:Base64.ALPHABET_OPTIONS},{name:"Remove non‑alphabet chars",type:"boolean",value:Base64.REMOVE_NON_ALPH_CHARS}]},"To Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation encodes data in an ASCII Base64 string.<br><br>e.g. <code>hello</code> becomes <code>aGVsbG8=</code>",run:Base64.run_to,highlight:Base64.highlight_to,highlight_reverse:Base64.highlight_from,input_type:"byte_array",output_type:"string",args:[{name:"Alphabet",type:"editabl
}]},ROT47:{description:"A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",run:Rotate.run_rot47,highlight:!0,highlight_reverse:!0,input_type:"byte_array",output_type:"byte_array",args:[{name:"Amount",type:"number",value:Rotate.ROT47_AMOUNT}]},"Strip HTTP headers":{description:"Removes HTTP headers from a request or response by looking for the first instance of a double newline.",run:HTTP.run_strip_headers,input_type:"string",output_type:"string",args:[]},"Parse User Agent":{description:"Attempts to identify and categorise information contained in a user-agent string.",run:HTTP.run_parse_user_agent,input_type:"string",output_type:"string",args:[]},"Format MAC addresses":{description:"Displays given MAC addresses in multiple different formats.<br><br>Expects addresses in a list separated by newlines, spaces or commas.<br><br>WARNING: There are no validity checks.",run:MAC.run_format,input_type:"string",output_type:"string",args:[{name:"Output case",type:"option",value:MAC.OUTPUT_CASE},{name:"No delimiter",type:"boolean",value:MAC.NO_DELIM},{name:"Dash delimiter",type:"boolean",value:MAC.DASH_DELIM},{name:"Colon delimiter",type:"boolean",value:MAC.COLON_DELIM},{name:"Cisco style",type:"boolean",value:MAC.CISCO_STYLE}]},"Offset checker":{description:"Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.",run:StrUtils.run_offset_checker,input_type:"string",output_type:"html",args:[{name:"Sample delimiter",type:"binary_string",value:StrUtils.OFF_CHK_SAMPLE_DELIMITER}]},"Remove whitespace":{description:"Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.<br><br>This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.",run:Tidy.run_remove_whitespace,input_type:"string",output_type:"string",args:[{name:"Spaces",type:"boolean",value:Tidy.REMOVE_SPACES},{name:"Carriage returns (\\r)",type:"boolean",value:Tidy.REMOVE_CARIAGE_RETURNS},{name:"Line feeds (\\n)",type:"boolean",value:Tidy.REMOVE_LINE_FEEDS},{name:"Tabs",type:"boolean",value:Tidy.REMOVE_TABS},{name:"Form feeds (\\f)",type:"boolean",value:Tidy.REMOVE_FORM_FEEDS},{name:"Full stops",type:"boolean",value:Tidy.REMOVE_FULL_STOPS}]},"Remove null bytes":{description:"Removes all null bytes (<code>0x00</code>) from the input.",run:Tidy.run_remove_nulls,input_type:"byte_array",output_type:"byte_array",args:[]},"Drop bytes":{description:"Cuts the specified number of bytes out of the data.",run:Tidy.run_drop_bytes,input_type:"byte_array",output_type:"byte_array",args:[{name:"Start",type:"number",value:Tidy.DROP_START},{name:"Length",type:"number",value:Tidy.DROP_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Take bytes":{description:"Takes a slice of the specified number of bytes from the data.",run:Tidy.run_take_bytes,input_type:"byte_array",output_type:"byte_array",args:[{name:"Start",type:"number",value:Tidy.TAKE_START},{name:"Length",type:"number",value:Tidy.TAKE_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Pad lines":{description:"Add the specified number of the specified character to the beginning or end of each line",run:Tidy.run_pad,input_type:"string",output_type:"string",args:[{name:"Position",type:"option",value:Tidy.PAD_POSITION},{name:"Length",type:"number",value:Tidy.PAD_LENGTH},{name:"Character",type:"binary_short_string",value:Tidy.PAD_CHAR}]},Reverse:{description:"Reverses the input string.",run:SeqUtils.run_reverse,input_type:"byte_array",output_type:"byte_array",args:[{name:"By",type:"option",value:SeqUtils.REVERSE_BY}]},Sort:{description:"Alphabetically sorts strings separated by the specified delimiter.<br><br>The IP address option supports IPv4 only.",run:SeqUtils.run_sort,input_type:"string",output_type:"string",args:[{name:"Delimiter",type:"option",value:SeqUtils.DELIMITER_OPTIONS},{name:"R
window.app.setup()};window.console=console||{log:function(){},error:function(){}},window.compile_time=moment.tz("Thu Dec 08 2016 00:33:37","ddd MMM D YYYY HH:mm:ss","UTC").valueOf(),window.compile_message="",document.addEventListener("DOMContentLoaded",main,!1);</script></body></html>
c+=Extract.run_ip(a,[!0,!0,!1]),c+="\nEmail addresses\n",c+=Extract.run_email(a,[]),c+="\nMAC addresses\n",c+=Extract.run_mac(a,[]),c+="\nURLs\n",c+=Extract.run_urls(a,[]),c+="\nDomain names\n",c+=Extract.run_domains(a,[]),c+="\nFile paths\n",c+=Extract.run_file_paths(a,[!0,!0]),c+="\nDates\n",c+=Extract.run_dates(a,[])}},FileType={run_detect:function(a,b){var c=FileType._magic_type(a);if(c){var d="File extension: "+c.ext+"\nMIME type: "+c.mime;return c.desc&&c.desc.length&&(d+="\nDescription: "+c.desc),d}return"Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?"},IGNORE_COMMON_BYTE_SEQUENCES:!0,run_scan_for_embedded_files:function(a,b){for(var c,d="Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any suffiently long file is likely to contain these magic bytes coincidentally.\n",e=b[0],f=["ico","ttf",""],g=0,h=0,i=0;i<a.length;i++)if(c=FileType._magic_type(a.slice(i))){if(e&&f.indexOf(c.ext)>-1){h++;continue}g++,d+="\nOffset "+i+" (0x"+Utils.hex(i)+"):\n File extension: "+c.ext+"\n MIME type: "+c.mime+"\n",c.desc&&c.desc.length&&(d+=" Description: "+c.desc+"\n")}return 0===g&&(d+="\nNo embedded files were found."),h>0&&(d+="\n\n"+h,d+=1===h?" file type was detected that has a common byte sequence. This is likely to be a false positive.":" file types were detected that have common byte sequences. These are likely to be false positives.",d+=" Run this operation with the 'Ignore common byte sequences' option unchecked to see details."),d},_magic_type:function(a){return a&&a.length>1?255===a[0]&&216===a[1]&&255===a[2]?{ext:"jpg",mime:"image/jpeg"}:137===a[0]&&80===a[1]&&78===a[2]&&71===a[3]?{ext:"png",mime:"image/png"}:71===a[0]&&73===a[1]&&70===a[2]?{ext:"gif",mime:"image/gif"}:87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]?{ext:"webp",mime:"image/webp"}:(73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3])&&67===a[8]&&82===a[9]?{ext:"cr2",mime:"image/x-canon-cr2"}:73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3]?{ext:"tif",mime:"image/tiff"}:66===a[0]&&77===a[1]?{ext:"bmp",mime:"image/bmp"}:73===a[0]&&73===a[1]&&188===a[2]?{ext:"jxr",mime:"image/vnd.ms-photo"}:56===a[0]&&66===a[1]&&80===a[2]&&83===a[3]?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:80===a[0]&&75===a[1]&&3===a[2]&&4===a[3]&&109===a[30]&&105===a[31]&&109===a[32]&&101===a[33]&&116===a[34]&&121===a[35]&&112===a[36]&&101===a[37]&&97===a[38]&&112===a[39]&&112===a[40]&&108===a[41]&&105===a[42]&&99===a[43]&&97===a[44]&&116===a[45]&&105===a[46]&&111===a[47]&&110===a[48]&&47===a[49]&&101===a[50]&&112===a[51]&&117===a[52]&&98===a[53]&&43===a[54]&&122===a[55]&&105===a[56]&&112===a[57]?{ext:"epub",mime:"application/epub+zip"}:80!==a[0]||75!==a[1]||3!==a[2]&&5!==a[2]&&7!==a[2]||4!==a[3]&&6!==a[3]&&8!==a[3]?117===a[257]&&115===a[258]&&116===a[259]&&97===a[260]&&114===a[261]?{ext:"tar",mime:"application/x-tar"}:82!==a[0]||97!==a[1]||114!==a[2]||33!==a[3]||26!==a[4]||7!==a[5]||0!==a[6]&&1!==a[6]?31===a[0]&&139===a[1]&&8===a[2]?{ext:"gz",mime:"application/gzip"}:66===a[0]&&90===a[1]&&104===a[2]?{ext:"bz2",mime:"application/x-bzip2"}:55===a[0]&&122===a[1]&&188===a[2]&&175===a[3]&&39===a[4]&&28===a[5]?{ext:"7z",mime:"application/x-7z-compressed"}:120===a[0]&&1===a[1]?{ext:"dmg",mime:"application/x-apple-diskimage"}:0===a[0]&&0===a[1]&&0===a[2]&&(24===a[3]||32===a[3])&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]||51===a[0]&&103===a[1]&&112===a[2]&&53===a[3]||0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&109===a[8]&&112===a[9]&&52===a[10]&&50===a[11]&&109===a[16]&&112===a[17]&&52===a[18]&&49===a[19]&&109===a[20]&&112===a[21]&&52===a[22]&&50===a[23]&&105===a[24]&&115===a[25]&&111===a[26]&&109===a[27]?{ext:"mp4",mime:"video/mp4"}:0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&77===a[8]&&52===a[9]&&86===a[10]?{ext:"m4v",mime:"video/x-m4v"}
j.hasOwnProperty(o)?j[o].push(m):j[o]=[m]}for(n in i)if(i[n]=i[n].sort(),l+=IP._ipv4_to_str(n)+"/"+d+"\n",!e){for(p=0;p<i[n].length;p++)l+=""+IP._ipv4_to_str(i[n][p])+"\n";l+="\n"}for(oinj)if(l+=o+"/"+d+"\n",!e){for(p=0;p<j[o].length;p++)l+=""+IP._ipv6_to_str(j[o][p],!0)+"\n";l+="\n"}returnl},_LARGE_RANGE_ERROR:'Thespecifiedrangecontainsmorethan65,536addresses.Runningthisquerycouldcrashyourbrowser.Ifyouwanttorunit,selectthe"Allowlargequeries"option.Youareadvisedtoturnoff"AutoBake"whilsteditinglargeranges.',_ipv4_cidr_range:function(a,b,c,d){vare="",f=IP._str_to_ipv4(a[1]),g=parseInt(a[2],10);if(g<0||g>31)return"IPv4 CIDR must be less than 32";var h=~(4294967295>>>g),i=f&h,j=i|~h;return b&&(e+="Network: "+IP._ipv4_to_str(f)+"\n",e+="CIDR: "+g+"\n",e+="Mask: "+IP._ipv4_to_str(h)+"\n",e+="Range: "+IP._ipv4_to_str(i)+" - "+IP._ipv4_to_str(j)+"\n",e+="Total addresses in range: "+((j-i>>>0)+1)+"\n\n"),c&&(e+=g>=16||d?IP._generate_ipv4_range(i,j).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6_cidr_range:function(a,b){var c="",d=IP._str_to_ipv6(a[1]),e=parseInt(a[a.length-1],10);if(e<0||e>127)return"IPv6 CIDR must be less than 128";for(var f=IP._gen_ipv6_mask(e),g=new Array(8),h=new Array(8),i="",j=new Array(128),k=0;k<8;k++)if(g[k]=d[k]&f[k],h[k]=g[k]|65535&~f[k],i=(h[k]-g[k]).toString(2),"0"!==i)for(varl=0;l<i.length;l++)j[16*k+16-(i.length-l)]=i[l];returnb&&(c+="Network:"+IP._ipv6_to_str(d)+"\n",c+="Shorthand:"+IP._ipv6_to_str(d,!0)+"\n",c+="CIDR:"+e+"\n",c+="Mask:"+IP._ipv6_to_str(f)+"\n",c+="Range:"+IP._ipv6_to_str(g)+"-"+IP._ipv6_to_str(h)+"\n",c+="Totaladdressesinrange:"+(parseInt(j.join(""),2)+1)+"\n\n"),c},_gen_ipv6_mask:function(a){for(varb,c=newArray(8),d=0;d<8;d++)a>16*(d+1)?c[d]=65535:(b=a-16*d,b<0&&(b=0),c[d]=~(65535>>>b|4294901760));return c},_ipv4_hyphenated_range:function(a,b,c,d){for(var e="",f=IP._str_to_ipv4(a[1]),g=IP._str_to_ipv4(a[2]),h=f^g,i=32,j=0;0!==h;)h>>=1,i--,j=j<<1|1;j=~j>>>0;var k=f&j,l=k&j,m=l|~j;return b&&(e+="Minimum subnet required to hold this range:\n",e+="\tNetwork: "+IP._ipv4_to_str(k)+"\n",e+="\tCIDR: "+i+"\n",e+="\tMask: "+IP._ipv4_to_str(j)+"\n",e+="\tSubnet range: "+IP._ipv4_to_str(l)+" - "+IP._ipv4_to_str(m)+"\n",e+="\tTotal addresses in subnet: "+((m-l>>>0)+1)+"\n\n",e+="Range: "+IP._ipv4_to_str(f)+" - "+IP._ipv4_to_str(g)+"\n",e+="Total addresses in range: "+((g-f>>>0)+1)+"\n\n"),c&&(e+=g-f>>>0<=65536||d?IP._generate_ipv4_range(f,g).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6_hyphenated_range:function(a,b){for(var c="",d=IP._str_to_ipv6(a[1]),e=IP._str_to_ipv6(a[14]),f="",g=new Array(128),h=0;h<128;h++)g[h]="0";for(h=0;h<8;h++)if(f=(e[h]-d[h]).toString(2),"0"!==f)for(vari=0;i<f.length;i++)g[16*h+16-(f.length-i)]=f[i];returnb&&(c+="Range:"+IP._ipv6_to_str(d)+"-"+IP._ipv6_to_str(e)+"\n",c+="Shorthandrange:"+IP._ipv6_to_str(d,!0)+"-"+IP._ipv6_to_str(e,!0)+"\n",c+="Totaladdressesinrange:"+(parseInt(g.join(""),2)+1)+"\n\n"),c},_str_to_ipv4:function(a){functionb(a){if(4!==a.length)throw"Morethan4blocks.";for(varb=[],c=0;c<4;c++)if(b[c]=parseInt(a[c],10),b[c]<0||b[c]>255)throw"Block out of range.";return b}var c=a.split("."),d=b(c),e=0;return e+=d[0]<<24,e+=d[1]<<16,e+=d[2]<<8,e+=d[3]},_ipv4_to_str:function(a){varb=a>>24&255,c=a>>16&255,d=a>>8&255,e=255&a;return b+"."+c+"."+d+"."+e},_str_to_ipv6:function(a){function b(a){if(a.length<3||a.length>8)throw"Badly formatted IPv6 address.";for(var b=[],c=0;c<a.length;c++)if(b[c]=parseInt(a[c],16),b[c]<0||b[c]>65535)throw"Block out of range.";return b}for(var c=a.split(":"),d=b(c),e=0,f=new Array(8),g=0;g<8;g++)isNaN(d[e])?(f[g]=0,g===8-d.slice(e).length&&e++):(f[g]=d[e],e++);returnf},_ipv6_to_str:function(a,b){varc="",d=0;if(b){vare=-1,f=-1,g=0,h=-1;for(d=0;d<8;d++)0===a[d]&&h===d-1?h=d:0===a[d]&&(g=d,h=d),h>=0&&h-g>f-e&&(e=g,f=h);for(d=0;d<8;d++)d!==e?c+=Utils.hex(a[d],1)+":":(c+=":",d=f,7===f&&(c+=":"));":"===c[0]&&(c=":"+c)}elsefor(d=0;d<8;d++)c+=Utils.hex(a[d],4)+":";returnc.slice(0,c.length-1)},_generate_ipv4_range:function(a,b){varc=[];if(b>=a)for(;a<=b;a++)c.
},{name:"Date / Time",ops:["Parse DateTime","Translate DateTime Format","From UNIX Timestamp","To UNIX Timestamp","Extract dates"]},{name:"Extractors",ops:["Strings","Extract IP addresses","Extract email addresses","Extract MAC addresses","Extract URLs","Extract domains","Extract file paths","Extract dates","Regular expression"]},{name:"Compression",ops:["Raw Deflate","Raw Inflate","Zlib Deflate","Zlib Inflate","Gzip","Gunzip","Zip","Unzip","Bzip2 Decompress"]},{name:"Hashing",ops:["Analyse hash","Generate all hashes","MD5","SHA1","SHA224","SHA256","SHA384","SHA512","SHA3","RIPEMD-160","HMAC","Fletcher-16 Checksum","Adler-32 Checksum","CRC-32 Checksum","TCP/IP Checksum"]},{name:"Code tidy",ops:["Syntax highlighter","Generic Code Beautify","JavaScript Parser","JavaScript Beautify","JavaScript Minify","JSON Beautify","JSON Minify","XML Beautify","XML Minify","SQL Beautify","SQL Minify","CSS Beautify","CSS Minify","Strip HTML tags","Diff"]},{name:"Other",ops:["Entropy","Frequency distribution","Detect File Type","Scan for Embedded Files","Generate UUID","Numberwang"]},{name:"Flow control",ops:["Fork","Merge","Jump","Conditional Jump","Return"]}],OperationConfig={Fork:{description:"Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.<br><br>For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.",run:FlowControl.run_fork,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Split delimiter",type:"binary_short_string",value:FlowControl.FORK_DELIM},{name:"Merge delimiter",type:"binary_short_string",value:FlowControl.MERGE_DELIM}]},Merge:{description:"Consolidate all branches back into a single trunk. The opposite of Fork.",run:FlowControl.run_merge,input_type:"string",output_type:"string",flow_control:!0,args:[]},Jump:{description:"Jump forwards or backwards over the specified number of operations.",run:FlowControl.run_jump,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Number of operations to jump over",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},"Conditional Jump":{description:"Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.",run:FlowControl.run_cond_jump,input_type:"string",output_type:"string",flow_control:!0,args:[{name:"Match (regex)",type:"string",value:""},{name:"Number of operations to jump over if match found",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},Return:{description:"End execution of operations at this point in the recipe.",run:FlowControl.run_return,input_type:"string",output_type:"string",flow_control:!0,args:[]},"From Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation decodes data from an ASCII Base64 string back into its raw format.<br><br>e.g. <code>aGVsbG8=</code> becomes <code>hello</code>",run:Base64.run_from,highlight:Base64.highlight_from,highlight_reverse:Base64.highlight_to,input_type:"string",output_type:"byte_array",args:[{name:"Alphabet",type:"editable_option",value:Base64.ALPHABET_OPTIONS},{name:"Remove non‑alphabet chars",type:"boolean",value:Base64.REMOVE_NON_ALPH_CHARS}]},"To Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation encodes data in an ASCII Base64 string.<br><br>e.g. <code>hello</code> becomes <code>aGVsbG8=</code>",run:Base64.run_to,highlight:Base64.highlight_to,highlight_reverse:Base64.highlight_from,input_type:"byte_array",output_type:"string",args:[{name:"Alphabet",type:"editabl
}]},ROT47:{description:"A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",run:Rotate.run_rot47,highlight:!0,highlight_reverse:!0,input_type:"byte_array",output_type:"byte_array",args:[{name:"Amount",type:"number",value:Rotate.ROT47_AMOUNT}]},"Strip HTTP headers":{description:"Removes HTTP headers from a request or response by looking for the first instance of a double newline.",run:HTTP.run_strip_headers,input_type:"string",output_type:"string",args:[]},"Parse User Agent":{description:"Attempts to identify and categorise information contained in a user-agent string.",run:HTTP.run_parse_user_agent,input_type:"string",output_type:"string",args:[]},"Format MAC addresses":{description:"Displays given MAC addresses in multiple different formats.<br><br>Expects addresses in a list separated by newlines, spaces or commas.<br><br>WARNING: There are no validity checks.",run:MAC.run_format,input_type:"string",output_type:"string",args:[{name:"Output case",type:"option",value:MAC.OUTPUT_CASE},{name:"No delimiter",type:"boolean",value:MAC.NO_DELIM},{name:"Dash delimiter",type:"boolean",value:MAC.DASH_DELIM},{name:"Colon delimiter",type:"boolean",value:MAC.COLON_DELIM},{name:"Cisco style",type:"boolean",value:MAC.CISCO_STYLE}]},"Offset checker":{description:"Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.",run:StrUtils.run_offset_checker,input_type:"string",output_type:"html",args:[{name:"Sample delimiter",type:"binary_string",value:StrUtils.OFF_CHK_SAMPLE_DELIMITER}]},"Remove whitespace":{description:"Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.<br><br>This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.",run:Tidy.run_remove_whitespace,input_type:"string",output_type:"string",args:[{name:"Spaces",type:"boolean",value:Tidy.REMOVE_SPACES},{name:"Carriage returns (\\r)",type:"boolean",value:Tidy.REMOVE_CARIAGE_RETURNS},{name:"Line feeds (\\n)",type:"boolean",value:Tidy.REMOVE_LINE_FEEDS},{name:"Tabs",type:"boolean",value:Tidy.REMOVE_TABS},{name:"Form feeds (\\f)",type:"boolean",value:Tidy.REMOVE_FORM_FEEDS},{name:"Full stops",type:"boolean",value:Tidy.REMOVE_FULL_STOPS}]},"Remove null bytes":{description:"Removes all null bytes (<code>0x00</code>) from the input.",run:Tidy.run_remove_nulls,input_type:"byte_array",output_type:"byte_array",args:[]},"Drop bytes":{description:"Cuts the specified number of bytes out of the data.",run:Tidy.run_drop_bytes,input_type:"byte_array",output_type:"byte_array",args:[{name:"Start",type:"number",value:Tidy.DROP_START},{name:"Length",type:"number",value:Tidy.DROP_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Take bytes":{description:"Takes a slice of the specified number of bytes from the data.",run:Tidy.run_take_bytes,input_type:"byte_array",output_type:"byte_array",args:[{name:"Start",type:"number",value:Tidy.TAKE_START},{name:"Length",type:"number",value:Tidy.TAKE_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Pad lines":{description:"Add the specified number of the specified character to the beginning or end of each line",run:Tidy.run_pad,input_type:"string",output_type:"string",args:[{name:"Position",type:"option",value:Tidy.PAD_POSITION},{name:"Length",type:"number",value:Tidy.PAD_LENGTH},{name:"Character",type:"binary_short_string",value:Tidy.PAD_CHAR}]},Reverse:{description:"Reverses the input string.",run:SeqUtils.run_reverse,input_type:"byte_array",output_type:"byte_array",args:[{name:"By",type:"option",value:SeqUtils.REVERSE_BY}]},Sort:{description:"Alphabetically sorts strings separated by the specified delimiter.<br><br>The IP address option supports IPv4 only.",run:SeqUtils.run_sort,input_type:"string",output_type:"string",args:[{name:"Delimiter",type:"option",value:SeqUtils.DELIMITER_OPTIONS},{name:"R
window.compile_time=moment.tz("Wed Dec 14 2016 16:37:29","ddd MMM D YYYY HH:mm:ss","UTC").valueOf(),window.compile_message="Merry Christmas! Have a look in the options panel for some festive flavour.",document.addEventListener("DOMContentLoaded",main,!1);</script></body></html>
function(){function a(a){this.code=a,this.message=Vc[a]}function b(b){var c=b.match(/\$?(?:(?![0-9-])(?:\w[\w.-]*|\*):)?(?![0-9-])(?:\w[\w.-]*|\*)|\(:|:\)|\/\/|\.\.|::|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?|\.\d+(?:[eE][+-]?\d+)?|"[^"]*(?:""[^"]*)*"|'[^']*(?:''[^']*)*'|<<|>>|[!<>]=|(?![0-9-])[\w-]+:\*|\s+|./g);if(c){for(var d=0,e=0,f=c.length;e<f;e++)"(:"==c[e]?d++:":)"==c[e]&&d?d--:d||/^\s/.test(c[e])||(this[this.length++]=c[e]);if(d)thrownewa("XPST0003")}}functionc(){}functiond(a,b,d,e){this.staticContext=a,this.item=b,this.scope=d||{},this.stack={},this.DOMAdapter=e||newc;varf=newEc,g=f.getTimezoneOffset();this.dateTime=new_a(f.getFullYear(),f.getMonth()+1,f.getDate(),f.getHours(),f.getMinutes(),f.getSeconds()+f.getMilliseconds()/1e3,-g),this.timezone=newAb(0,Gc.abs(~~(g/60)),Gc.abs(g%60),0,g>0)}function e(){this.dataTypes={},this.documents={},this.functions={},this.collations={},this.collections={}}function f(a,b,c){Xc[a]=c,Yc[a]=b}function g(a,b){Zc[a]=b}function h(c,d){var e=new b(c),f=l(e,d);if(!e.eof())throw new a("XPST0003");if(!f)throw new a("XPST0003");this.internalExpression=f}function i(){}function j(){}function k(){this.items=[]}function l(b,c){var d;if(!b.eof()&&(d=m(b,c))){var e=new k;for(e.items.push(d);","==b.peek();){if(b.next(),b.eof()||!(d=m(b,c)))throw new a("XPST0003");e.items.push(d)}return e}}function m(a,b){if(!a.eof())return s(a,b)||o(a,b)||u(a,b)||K(a,b)}function n(){this.bindings=[],this.returnExpr=null}function o(b,c){if("for"==b.peek()&&"$"==b.peek(1).substr(0,1)){b.next();var d,e=new n;do e.bindings.push(q(b,c));while(","==b.peek()&&b.next());if("return"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(d=m(b,c)))throw new a("XPST0003");return e.returnExpr=d,e}}function p(a,b,c,d){this.prefix=a,this.localName=b,this.namespaceURI=c,this.inExpr=d}function q(b,c){var d=b.peek().substr(1).match(id);if(!d)throw new a("XPST0003");if("*"==d[1]||"*"==d[2])throw new a("XPST0003");if(b.next(),"in"!=b.peek())throw new a("XPST0003");b.next();var e;if(b.eof()||!(e=m(b,c)))throw new a("XPST0003");return new p(d[1]||null,d[2],d[1]?c.getURIForPrefix(d[1]):null,e)}function r(a,b,c){this.condExpr=a,this.thenExpr=b,this.elseExpr=c}function s(b,c){var d,e,f;if("if"==b.peek()&&"("==b.peek(1)){if(b.next(2),b.eof()||!(d=l(b,c)))throw new a("XPST0003");if(")"!=b.peek())throw new a("XPST0003");if(b.next(),"then"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(e=m(b,c)))throw new a("XPST0003");if("else"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(f=m(b,c)))throw new a("XPST0003");return new r(d,e,f)}}function t(a){this.quantifier=a,this.bindings=[],this.satisfiesExpr=null}function u(b,c){var d=b.peek();if(("some"==d||"every"==d)&&"$"==b.peek(1).substr(0,1)){b.next();var e,f=new t(d);do f.bindings.push(w(b,c));while(","==b.peek()&&b.next());if("satisfies"!=b.peek())throw new a("XPST0003");if(b.next(),b.eof()||!(e=m(b,c)))throw new a("XPST0003");return f.satisfiesExpr=e,f}}function v(a,b,c,d){this.prefix=a,this.localName=b,this.namespaceURI=c,this.inExpr=d}function w(b,c){var d=b.peek().substr(1).match(id);if(!d)throw new a("XPST0003");if("*"==d[1]||"*"==d[2])throw new a("XPST0003");if(b.next(),"in"!=b.peek())throw new a("XPST0003");b.next();var e;if(b.eof()||!(e=m(b,c)))throw new a("XPST0003");return new v(d[1]||null,d[2],d[1]?c.getURIForPrefix(d[1]):null,e)}function x(a,b,c){this.left=a,this.right=b,this.operator=c}function y(b,c){var d,e;if(!b.eof()&&(d=ya(b,c))){if(!(b.peek()in cd))return d;var f=b.peek();if(b.next(),b.eof()||!(e=ya(b,c)))throw new a("XPST0003");return new x(d,e,f)}}function z(a,b){var c=vc(a.left.evaluate(b),b);if(!c.length)return new Xa(!1);var d=vc(a.right.evaluate(b),b);if(!d.length)return new Xa(!1);for(var e,f,g=!1,h=0,i=c.length;h<i&&!g;h++)for(varj,k,l=0,m=d.length;l<m&&!g;l++)f=c[h],k=d[l],e=finstanceofxb,j=kinstanceofxb,e&&j?(f=ub.cast(f),k=ub.cast(k)):(e?kinstanceofAb?f=Ab.cast(f):kinstanceofyb?f=yb.cast(f):k.primitiveKind&&(f=Zc[k.primitiveKind].cast(f)):j&&(finstanceofAb?k=Ab.cast(k):finstanceofyb?k=yb.cast(k):f.primitiveKind&&(k=Zc[f.primi
Ob.cast=function(b){var c;try{c=Cb.cast(b)}catch(a){throw a}if(c.value>=1&&c.value<=255)return new Ob(c.value);throw new a("FORG0001")},g("unsignedByte",Ob),Pb.prototype=new ub,Pb.prototype.builtInKind=j.NORMALIZEDSTRING_DT,Pb.cast=function(a){return new Pb(Ac(a))},g("normalizedString",Pb),Qb.prototype=new Pb,Qb.prototype.builtInKind=j.TOKEN_DT,Qb.cast=function(a){return new Qb(Ac(a))},g("token",Qb),Rb.prototype=new Qb,Rb.prototype.builtInKind=j.NAME_DT,Rb.cast=function(a){return new Rb(Ac(a))},g("Name",Rb),Sb.prototype=new Rb,Sb.prototype.builtInKind=j.NCNAME_DT,Sb.cast=function(a){return new Sb(Ac(a))},g("NCName",Sb),Tb.prototype=new Sb,Tb.prototype.builtInKind=j.ENTITY_DT,Tb.cast=function(a){return new Tb(Ac(a))},g("ENTITY",Tb),Ub.prototype=new Sb,Ub.prototype.builtInKind=j.ID_DT,Ub.cast=function(a){return new Ub(Ac(a))},g("ID",Ub),Vb.prototype=new Sb,Vb.prototype.builtInKind=j.IDREF_DT,Vb.cast=function(a){return new Vb(Ac(a))},g("IDREF",Vb),Wb.prototype=new Qb,Wb.prototype.builtInKind=j.LANGUAGE_DT,Wb.cast=function(a){return new Wb(Ac(a))},g("language",Wb),Xb.prototype=new Qb,Xb.prototype.builtInKind=j.NMTOKEN_DT,Xb.cast=function(a){return new Xb(Ac(a))},g("NMTOKEN",Xb),Zb.prototype=new Yb,$b.prototype=new Zb,_b.prototype=new Zb,ac.prototype=new Zb,bc.prototype=new Zb,cc.prototype=new Zb,dc.prototype=new Zb,$c["hexBinary-equal"]=function(a,b){return new Xa(a.valueOf()==b.valueOf())},$c["base64Binary-equal"]=function(a,b){return new Xa(a.valueOf()==b.valueOf())},$c["boolean-equal"]=function(a,b){return new Xa(a.valueOf()==b.valueOf())},$c["boolean-less-than"]=function(a,b){return new Xa(a.valueOf()<b.valueOf())},$c["boolean-greater-than"]=function(a,b){returnnewXa(a.valueOf()>b.valueOf())},$c["yearMonthDuration-less-than"]=function(a,b){return new Xa(lc(a)<lc(b))},$c["yearMonthDuration-greater-than"]=function(a,b){returnnewXa(lc(a)>lc(b))},$c["dayTimeDuration-less-than"]=function(a,b){return new Xa(jc(a)<jc(b))},$c["dayTimeDuration-greater-than"]=function(a,b){returnnewXa(jc(a)>jc(b))},$c["duration-equal"]=function(a,b){return new Xa(a.negative==b.negative&&lc(a)==lc(b)&&jc(a)==jc(b))},$c["dateTime-equal"]=function(a,b){return gc(a,b,"eq")},$c["dateTime-less-than"]=function(a,b){return gc(a,b,"lt")},$c["dateTime-greater-than"]=function(a,b){return gc(a,b,"gt")},$c["date-equal"]=function(a,b){return fc(a,b,"eq")},$c["date-less-than"]=function(a,b){return fc(a,b,"lt")},$c["date-greater-than"]=function(a,b){return fc(a,b,"gt")},$c["time-equal"]=function(a,b){return ec(a,b,"eq")},$c["time-less-than"]=function(a,b){return ec(a,b,"lt")},$c["time-greater-than"]=function(a,b){return ec(a,b,"gt")},$c["gYearMonth-equal"]=function(a,b){return gc(new _a(a.year,a.month,Za(a.year,a.month),0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(b.year,b.month,Za(b.year,b.month),0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gYear-equal"]=function(a,b){return gc(new _a(a.year,1,1,0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(b.year,1,1,0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gMonthDay-equal"]=function(a,b){return gc(new _a(1972,a.month,a.day,0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(1972,b.month,b.day,0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gMonth-equal"]=function(a,b){return gc(new _a(1972,a.month,Za(1972,b.month),0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(1972,b.month,Za(1972,b.month),0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["gDay-equal"]=function(a,b){return gc(new _a(1972,12,a.day,0,0,0,null==a.timezone?this.timezone:a.timezone),new _a(1972,12,b.day,0,0,0,null==b.timezone?this.timezone:b.timezone),"eq")},$c["add-yearMonthDurations"]=function(a,b){return mc(lc(a)+lc(b))},$c["subtract-yearMonthDurations"]=function(a,b){return mc(lc(a)-lc(b))},$c["multiply-yearMonthDuration"]=function(a,b){return mc(lc(a)*b)},$c["divide-yearMonthDuration"]=function(a,b){return mc(lc(a)/b)},$c["divide-yearMonthDuration-by-yearMonthDuration"]=function(a,b){return new fb(lc(a)/lc(b))},$c["add-dayTimeDurations"]=function(a,b){return kc(jc(a
var c="";return c+="IP addresses\n",c+=Extract.runIp(a,[!0,!0,!1]),c+="\nEmail addresses\n",c+=Extract.runEmail(a,[]),c+="\nMAC addresses\n",c+=Extract.runMac(a,[]),c+="\nURLs\n",c+=Extract.runUrls(a,[]),c+="\nDomain names\n",c+=Extract.runDomains(a,[]),c+="\nFile paths\n",c+=Extract.runFilePaths(a,[!0,!0]),c+="\nDates\n",c+=Extract.runDates(a,[])}},FileType={runDetect:function(a,b){var c=FileType._magicType(a);if(c){var d="File extension: "+c.ext+"\nMIME type: "+c.mime;return c.desc&&c.desc.length&&(d+="\nDescription: "+c.desc),d}return"Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?"},IGNORE_COMMON_BYTE_SEQUENCES:!0,runScanForEmbeddedFiles:function(a,b){for(var c,d="Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any suffiently long file is likely to contain these magic bytes coincidentally.\n",e=b[0],f=["ico","ttf",""],g=0,h=0,i=0;i<a.length;i++)if(c=FileType._magicType(a.slice(i))){if(e&&f.indexOf(c.ext)>-1){h++;continue}g++,d+="\nOffset "+i+" (0x"+Utils.hex(i)+"):\n File extension: "+c.ext+"\n MIME type: "+c.mime+"\n",c.desc&&c.desc.length&&(d+=" Description: "+c.desc+"\n")}return 0===g&&(d+="\nNo embedded files were found."),h>0&&(d+="\n\n"+h,d+=1===h?" file type was detected that has a common byte sequence. This is likely to be a false positive.":" file types were detected that have common byte sequences. These are likely to be false positives.",d+=" Run this operation with the 'Ignore common byte sequences' option unchecked to see details."),d},_magicType:function(a){return a&&a.length>1?255===a[0]&&216===a[1]&&255===a[2]?{ext:"jpg",mime:"image/jpeg"}:137===a[0]&&80===a[1]&&78===a[2]&&71===a[3]?{ext:"png",mime:"image/png"}:71===a[0]&&73===a[1]&&70===a[2]?{ext:"gif",mime:"image/gif"}:87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]?{ext:"webp",mime:"image/webp"}:(73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3])&&67===a[8]&&82===a[9]?{ext:"cr2",mime:"image/x-canon-cr2"}:73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3]?{ext:"tif",mime:"image/tiff"}:66===a[0]&&77===a[1]?{ext:"bmp",mime:"image/bmp"}:73===a[0]&&73===a[1]&&188===a[2]?{ext:"jxr",mime:"image/vnd.ms-photo"}:56===a[0]&&66===a[1]&&80===a[2]&&83===a[3]?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:80===a[0]&&75===a[1]&&3===a[2]&&4===a[3]&&109===a[30]&&105===a[31]&&109===a[32]&&101===a[33]&&116===a[34]&&121===a[35]&&112===a[36]&&101===a[37]&&97===a[38]&&112===a[39]&&112===a[40]&&108===a[41]&&105===a[42]&&99===a[43]&&97===a[44]&&116===a[45]&&105===a[46]&&111===a[47]&&110===a[48]&&47===a[49]&&101===a[50]&&112===a[51]&&117===a[52]&&98===a[53]&&43===a[54]&&122===a[55]&&105===a[56]&&112===a[57]?{ext:"epub",mime:"application/epub+zip"}:80!==a[0]||75!==a[1]||3!==a[2]&&5!==a[2]&&7!==a[2]||4!==a[3]&&6!==a[3]&&8!==a[3]?117===a[257]&&115===a[258]&&116===a[259]&&97===a[260]&&114===a[261]?{ext:"tar",mime:"application/x-tar"}:82!==a[0]||97!==a[1]||114!==a[2]||33!==a[3]||26!==a[4]||7!==a[5]||0!==a[6]&&1!==a[6]?31===a[0]&&139===a[1]&&8===a[2]?{ext:"gz",mime:"application/gzip"}:66===a[0]&&90===a[1]&&104===a[2]?{ext:"bz2",mime:"application/x-bzip2"}:55===a[0]&&122===a[1]&&188===a[2]&&175===a[3]&&39===a[4]&&28===a[5]?{ext:"7z",mime:"application/x-7z-compressed"}:120===a[0]&&1===a[1]?{ext:"dmg",mime:"application/x-apple-diskimage"}:0===a[0]&&0===a[1]&&0===a[2]&&(24===a[3]||32===a[3])&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]||51===a[0]&&103===a[1]&&112===a[2]&&53===a[3]||0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&109===a[8]&&112===a[9]&&52===a[10]&&50===a[11]&&109===a[16]&&112===a[17]&&52===a[18]&&49===a[19]&&109===a[20]&&112===a[21]&&52===a[22]&&50===a[23]&&105===a[24]&&115===a[25]&&111===a[26]&&109===a[27]?{ext:"mp4",mime:"video/mp4"}:0===a[0]&&0===a[1]&&0===a[2]&&28===a[3]&&102===a[4]&&116===a[5]&&121===a[6]&&112===a[7]&&77===a[8]&&52===a[9]&&86===a[10]?{ext:"m4v"
if(d<0||d>127)return"CIDR must be less than 32 for IPv4 or 128 for IPv6";for(var p=0;p<h.length;p++)if(k=IP.IPV4_REGEX.exec(h[p]))m=IP._strToIpv4(k[1])>>>0,n=m&f,i.hasOwnProperty(n)?i[n].push(m):i[n]=[m];else if(k=IP.IPV6_REGEX.exec(h[p])){m=IP._strToIpv6(k[1]),n=[],o="";for(var q=0;q<8;q++)n.push(m[q]&g[q]);o=IP._ipv6ToStr(n,!0),j.hasOwnProperty(o)?j[o].push(m):j[o]=[m]}for(nini)if(i[n]=i[n].sort(),l+=IP._ipv4ToStr(n)+"/"+d+"\n",!e){for(p=0;p<i[n].length;p++)l+=""+IP._ipv4ToStr(i[n][p])+"\n";l+="\n"}for(oinj)if(l+=o+"/"+d+"\n",!e){for(p=0;p<j[o].length;p++)l+=""+IP._ipv6ToStr(j[o][p],!0)+"\n";l+="\n"}returnl},_LARGE_RANGE_ERROR:'Thespecifiedrangecontainsmorethan65,536addresses.Runningthisquerycouldcrashyourbrowser.Ifyouwanttorunit,selectthe"Allowlargequeries"option.Youareadvisedtoturnoff"AutoBake"whilsteditinglargeranges.',_ipv4CidrRange:function(a,b,c,d){vare="",f=IP._strToIpv4(a[1]),g=parseInt(a[2],10);if(g<0||g>31)return"IPv4 CIDR must be less than 32";var h=~(4294967295>>>g),i=f&h,j=i|~h;return b&&(e+="Network: "+IP._ipv4ToStr(f)+"\n",e+="CIDR: "+g+"\n",e+="Mask: "+IP._ipv4ToStr(h)+"\n",e+="Range: "+IP._ipv4ToStr(i)+" - "+IP._ipv4ToStr(j)+"\n",e+="Total addresses in range: "+((j-i>>>0)+1)+"\n\n"),c&&(e+=g>=16||d?IP._generateIpv4Range(i,j).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6CidrRange:function(a,b){var c="",d=IP._strToIpv6(a[1]),e=parseInt(a[a.length-1],10);if(e<0||e>127)return"IPv6 CIDR must be less than 128";for(var f=IP._genIpv6Mask(e),g=new Array(8),h=new Array(8),i="",j=new Array(128),k=0;k<8;k++)if(g[k]=d[k]&f[k],h[k]=g[k]|65535&~f[k],i=(h[k]-g[k]).toString(2),"0"!==i)for(varl=0;l<i.length;l++)j[16*k+16-(i.length-l)]=i[l];returnb&&(c+="Network:"+IP._ipv6ToStr(d)+"\n",c+="Shorthand:"+IP._ipv6ToStr(d,!0)+"\n",c+="CIDR:"+e+"\n",c+="Mask:"+IP._ipv6ToStr(f)+"\n",c+="Range:"+IP._ipv6ToStr(g)+"-"+IP._ipv6ToStr(h)+"\n",c+="Totaladdressesinrange:"+(parseInt(j.join(""),2)+1)+"\n\n"),c},_genIpv6Mask:function(a){for(varb,c=newArray(8),d=0;d<8;d++)a>16*(d+1)?c[d]=65535:(b=a-16*d,b<0&&(b=0),c[d]=~(65535>>>b|4294901760));return c},_ipv4HyphenatedRange:function(a,b,c,d){for(var e="",f=IP._strToIpv4(a[1]),g=IP._strToIpv4(a[2]),h=f^g,i=32,j=0;0!==h;)h>>=1,i--,j=j<<1|1;j=~j>>>0;var k=f&j,l=k&j,m=l|~j;return b&&(e+="Minimum subnet required to hold this range:\n",e+="\tNetwork: "+IP._ipv4ToStr(k)+"\n",e+="\tCIDR: "+i+"\n",e+="\tMask: "+IP._ipv4ToStr(j)+"\n",e+="\tSubnet range: "+IP._ipv4ToStr(l)+" - "+IP._ipv4ToStr(m)+"\n",e+="\tTotal addresses in subnet: "+((m-l>>>0)+1)+"\n\n",e+="Range: "+IP._ipv4ToStr(f)+" - "+IP._ipv4ToStr(g)+"\n",e+="Total addresses in range: "+((g-f>>>0)+1)+"\n\n"),c&&(e+=g-f>>>0<=65536||d?IP._generateIpv4Range(f,g).join("\n"):IP._LARGE_RANGE_ERROR),e},_ipv6HyphenatedRange:function(a,b){for(var c="",d=IP._strToIpv6(a[1]),e=IP._strToIpv6(a[14]),f="",g=new Array(128),h=0;h<128;h++)g[h]="0";for(h=0;h<8;h++)if(f=(e[h]-d[h]).toString(2),"0"!==f)for(vari=0;i<f.length;i++)g[16*h+16-(f.length-i)]=f[i];returnb&&(c+="Range:"+IP._ipv6ToStr(d)+"-"+IP._ipv6ToStr(e)+"\n",c+="Shorthandrange:"+IP._ipv6ToStr(d,!0)+"-"+IP._ipv6ToStr(e,!0)+"\n",c+="Totaladdressesinrange:"+(parseInt(g.join(""),2)+1)+"\n\n"),c},_strToIpv4:function(a){functionb(a){if(4!==a.length)throw"Morethan4blocks.";for(varb=[],c=0;c<4;c++)if(b[c]=parseInt(a[c],10),b[c]<0||b[c]>255)throw"Block out of range.";return b}var c=a.split("."),d=b(c),e=0;return e+=d[0]<<24,e+=d[1]<<16,e+=d[2]<<8,e+=d[3]},_ipv4ToStr:function(a){varb=a>>24&255,c=a>>16&255,d=a>>8&255,e=255&a;return b+"."+c+"."+d+"."+e},_strToIpv6:function(a){function b(a){if(a.length<3||a.length>8)throw"Badly formatted IPv6 address.";for(var b=[],c=0;c<a.length;c++)if(b[c]=parseInt(a[c],16),b[c]<0||b[c]>65535)throw"Block out of range.";return b}for(var c=a.split(":"),d=b(c),e=0,f=new Array(8),g=0;g<8;g++)isNaN(d[e])?(f[g]=0,g===8-d.slice(e).length&&e++):(f[g]=d[e],e++);returnf},_ipv6ToStr:function(a,b){varc="",d=0;if(b){vare=-1,f=-1,g=0,h=-1;for(d=0;d<8;d++)0===a[d]&&h===d-1?h=d:0===a[d]&&(g=d,h=d),h>=0&&h-g>f-e&&
},{name:"Language",ops:["Text encoding","Unescape Unicode Characters"]},{name:"Utils",ops:["Diff","Remove whitespace","Remove null bytes","To Upper case","To Lower case","Add line numbers","Remove line numbers","Reverse","Sort","Unique","Split","Filter","Count occurrences","Expand alphabet range","Parse escaped string","Drop bytes","Take bytes","Pad lines","Find / Replace","Regular expression","Offset checker","Convert distance","Convert area","Convert mass","Convert speed","Convert data units","Parse UNIX file permissions","Swap endianness","Parse colour code"]},{name:"Date / Time",ops:["Parse DateTime","Translate DateTime Format","From UNIX Timestamp","To UNIX Timestamp","Extract dates"]},{name:"Extractors",ops:["Strings","Extract IP addresses","Extract email addresses","Extract MAC addresses","Extract URLs","Extract domains","Extract file paths","Extract dates","Regular expression","XPath expression","CSS selector"]},{name:"Compression",ops:["Raw Deflate","Raw Inflate","Zlib Deflate","Zlib Inflate","Gzip","Gunzip","Zip","Unzip","Bzip2 Decompress"]},{name:"Hashing",ops:["Analyse hash","Generate all hashes","MD2","MD4","MD5","SHA0","SHA1","SHA224","SHA256","SHA384","SHA512","SHA3","RIPEMD-160","HMAC","Fletcher-8 Checksum","Fletcher-16 Checksum","Fletcher-32 Checksum","Fletcher-64 Checksum","Adler-32 Checksum","CRC-32 Checksum","TCP/IP Checksum"]},{name:"Code tidy",ops:["Syntax highlighter","Generic Code Beautify","JavaScript Parser","JavaScript Beautify","JavaScript Minify","JSON Beautify","JSON Minify","XML Beautify","XML Minify","SQL Beautify","SQL Minify","CSS Beautify","CSS Minify","XPath expression","CSS selector","Strip HTML tags","Diff"]},{name:"Other",ops:["Entropy","Frequency distribution","Detect File Type","Scan for Embedded Files","Generate UUID","Numberwang"]},{name:"Flow control",ops:["Fork","Merge","Jump","Conditional Jump","Return"]}],OperationConfig={Fork:{description:"Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.<br><br>For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.",run:FlowControl.runFork,inputType:"string",outputType:"string",flowControl:!0,args:[{name:"Split delimiter",type:"binaryShortString",value:FlowControl.FORK_DELIM},{name:"Merge delimiter",type:"binaryShortString",value:FlowControl.MERGE_DELIM},{name:"Ignore errors",type:"boolean",value:FlowControl.FORK_IGNORE_ERRORS}]},Merge:{description:"Consolidate all branches back into a single trunk. The opposite of Fork.",run:FlowControl.runMerge,inputType:"string",outputType:"string",flowControl:!0,args:[]},Jump:{description:"Jump forwards or backwards over the specified number of operations.",run:FlowControl.runJump,inputType:"string",outputType:"string",flowControl:!0,args:[{name:"Number of operations to jump over",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},"Conditional Jump":{description:"Conditionally jump forwards or backwards over the specified number of operations based on whether the data matches the specified regular expression.",run:FlowControl.runCondJump,inputType:"string",outputType:"string",flowControl:!0,args:[{name:"Match (regex)",type:"string",value:""},{name:"Number of operations to jump over if match found",type:"number",value:FlowControl.JUMP_NUM},{name:"Maximum jumps (if jumping backwards)",type:"number",value:FlowControl.MAX_JUMPS}]},Return:{description:"End execution of operations at this point in the recipe.",run:FlowControl.runReturn,inputType:"string",outputType:"string",flowControl:!0,args:[]},"From Base64":{description:"Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation decodes data from an ASCII Base64 string back into its raw format.<br><br>e.g. <code>aGVsbG8=</code> becomes <code>hello</code>",run:Bas
run:Rotate.runRot13,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Rotate lower case chars",type:"boolean",value:Rotate.ROT13_LOWERCASE},{name:"Rotate upper case chars",type:"boolean",value:Rotate.ROT13_UPPERCASE},{name:"Amount",type:"number",value:Rotate.ROT13_AMOUNT}]},ROT47:{description:"A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",run:Rotate.runRot47,highlight:!0,highlightReverse:!0,inputType:"byteArray",outputType:"byteArray",args:[{name:"Amount",type:"number",value:Rotate.ROT47_AMOUNT}]},"Strip HTTP headers":{description:"Removes HTTP headers from a request or response by looking for the first instance of a double newline.",run:HTTP.runStripHeaders,inputType:"string",outputType:"string",args:[]},"Parse User Agent":{description:"Attempts to identify and categorise information contained in a user-agent string.",run:HTTP.runParseUserAgent,inputType:"string",outputType:"string",args:[]},"Format MAC addresses":{description:"Displays given MAC addresses in multiple different formats.<br><br>Expects addresses in a list separated by newlines, spaces or commas.<br><br>WARNING: There are no validity checks.",run:MAC.runFormat,inputType:"string",outputType:"string",args:[{name:"Output case",type:"option",value:MAC.OUTPUT_CASE},{name:"No delimiter",type:"boolean",value:MAC.NO_DELIM},{name:"Dash delimiter",type:"boolean",value:MAC.DASH_DELIM},{name:"Colon delimiter",type:"boolean",value:MAC.COLON_DELIM},{name:"Cisco style",type:"boolean",value:MAC.CISCO_STYLE}]},"Offset checker":{description:"Compares multiple inputs (separated by the specified delimiter) and highlights matching characters which appear at the same position in all samples.",run:StrUtils.runOffsetChecker,inputType:"string",outputType:"html",args:[{name:"Sample delimiter",type:"binaryString",value:StrUtils.OFF_CHK_SAMPLE_DELIMITER}]},"Remove whitespace":{description:"Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.<br><br>This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.",run:Tidy.runRemoveWhitespace,inputType:"string",outputType:"string",args:[{name:"Spaces",type:"boolean",value:Tidy.REMOVE_SPACES},{name:"Carriage returns (\\r)",type:"boolean",value:Tidy.REMOVE_CARIAGE_RETURNS},{name:"Line feeds (\\n)",type:"boolean",value:Tidy.REMOVE_LINE_FEEDS},{name:"Tabs",type:"boolean",value:Tidy.REMOVE_TABS},{name:"Form feeds (\\f)",type:"boolean",value:Tidy.REMOVE_FORM_FEEDS},{name:"Full stops",type:"boolean",value:Tidy.REMOVE_FULL_STOPS}]},"Remove null bytes":{description:"Removes all null bytes (<code>0x00</code>) from the input.",run:Tidy.runRemoveNulls,inputType:"byteArray",outputType:"byteArray",args:[]},"Drop bytes":{description:"Cuts the specified number of bytes out of the data.",run:Tidy.runDropBytes,inputType:"byteArray",outputType:"byteArray",args:[{name:"Start",type:"number",value:Tidy.DROP_START},{name:"Length",type:"number",value:Tidy.DROP_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Take bytes":{description:"Takes a slice of the specified number of bytes from the data.",run:Tidy.runTakeBytes,inputType:"byteArray",outputType:"byteArray",args:[{name:"Start",type:"number",value:Tidy.TAKE_START},{name:"Length",type:"number",value:Tidy.TAKE_LENGTH},{name:"Apply to each line",type:"boolean",value:Tidy.APPLY_TO_EACH_LINE}]},"Pad lines":{description:"Add the specified number of the specified character to the beginning or end of each line",run:Tidy.runPad,inputType:"string",outputType:"string",args:[{name:"Position",type:"option",value:Tidy.PAD_POSITION},{name:"Length",type:"number",value:Tidy.PAD_LENGTH},{name:"Character",type:"binaryShortString",value:Tidy.PAD_CHAR}]},Reverse:{description:"Reverses the input string.",run:SeqUtils.runReverse,inputType:"byteArray",outputType:"byteArray",args:[{name:"By",type:"option",value:SeqUtils.REVERSE_BY}]},Sort:{description:"Alp
run:StrUtils.runDiff,inputType:"string",outputType:"html",args:[{name:"Sample delimiter",type:"binaryString",value:StrUtils.DIFF_SAMPLE_DELIMITER},{name:"Diff by",type:"option",value:StrUtils.DIFF_BY},{name:"Show added",type:"boolean",value:!0},{name:"Show removed",type:"boolean",value:!0},{name:"Ignore whitespace (relevant for word and line)",type:"boolean",value:!1}]},"Parse UNIX file permissions":{description:"Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.<br><br>Input should be in either octal (e.g. <code>755</code>) or textual (e.g. <code>drwxr-xr-x</code>) format.",run:OS.runParseUnixPerms,inputType:"string",outputType:"string",args:[]},"Swap endianness":{description:"Switches the data from big-endian to little-endian or vice-versa. Data can be read in as hexadecimal or raw bytes. It will be returned in the same format as it is entered.",run:Endian.runSwapEndianness,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"string",args:[{name:"Data format",type:"option",value:Endian.DATA_FORMAT},{name:"Word length (bytes)",type:"number",value:Endian.WORD_LENGTH},{name:"Pad incomplete words",type:"boolean",value:Endian.PAD_INCOMPLETE_WORDS}]},"Syntax highlighter":{description:"Adds syntax highlighting to a range of source code languages. Note that this will not indent the code. Use one of the 'Beautify' operations for that.",run:Code.runSyntaxHighlight,highlight:!0,highlightReverse:!0,inputType:"string",outputType:"html",args:[{name:"Language/File extension",type:"option",value:Code.LANGUAGES},{name:"Display line numbers",type:"boolean",value:Code.LINE_NUMS}]},"Parse escaped string":{description:"Replaces escaped characters with the bytes they represent.<br><br>e.g.<code>Hello\\nWorld</code> becomes <code>Hello<br>World</code>",run:StrUtils.runParseEscapedString,inputType:"string",outputType:"string",args:[]},"TCP/IP Checksum":{description:"Calculates the checksum for a TCP (Transport Control Protocol) or IP (Internet Protocol) header from an input of raw bytes.",run:Checksum.runTCPIP,inputType:"byteArray",outputType:"string",args:[]},"Parse colour code":{description:"Converts a colour code in a standard format to other standard formats and displays the colour itself.<br><br><strong>Example inputs</strong><ul><li><code>#d9edf7</code></li><li><code>rgba(217,237,247,1)</code></li><li><code>hsla(200,65%,91%,1)</code></li><li><code>cmyk(0.12, 0.04, 0.00, 0.03)</code></li></ul>",run:HTML.runParseColourCode,inputType:"string",outputType:"html",args:[]},"Generate UUID":{description:"Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).<br><br>A version 4 UUID relies on random numbers, in this case generated using <code>window.crypto</code> if available and falling back to <code>Math.random</code> if not.",run:UUID.runGenerateV4,inputType:"string",outputType:"string",args:[]},Substitute:{description:"A substitution cipher allowing you to specify bytes to replace with other byte values. This can be used to create Caesar ciphers but is more powerful as any byte value can be substituted, not just letters, and the substitution values need not be in order.<br><br>Enter the bytes you want to replace in the Plaintext field and the bytes to replace them with in the Ciphertext field.<br><br>Non-printable bytes can be specified using string escape notation. For example, a line feed character can be written as either <code>\\n</code> or <code>\\x0a</code>.<br><br>Byte ranges can be specified using a hyphen. For example, the sequence <code>0123456789</code> can be written as <code>0-9</code>.",run:Cipher.runSubstitute,inputType:"byteArray",outputType:"byteArray",args:[{name:"Plaintext",type:"binaryString",value:Cipher.SUBS_PLAINTEXT},{name:"Ciphertext",type:"binaryString",value:Cipher.SUBS_CIPHERTEXT}]}},ControlsWaiter=function(a,b){this.app=a,this.manager=b};ControlsWaiter.prototype.adjustWidth=function(){var a=document.getElementById("controls"),b=docume
b>=0&&(this.name=this.name.slice(0,b)+"<b><u>"+this.name.slice(b,b+a.length)+"</u></b>"+this.name.slice(b+a.length)),this.description&&c>=0&&(this.description=this.description.slice(0,c)+"<b><u>"+this.description.slice(c,c+a.length)+"</u></b>"+this.description.slice(c+a.length))};var InputWaiter=function(a,b){this.app=a,this.manager=b,this.badKeys=[16,17,18,19,20,27,33,34,35,36,37,38,39,40,44,91,92,93,112,113,114,115,116,117,118,119,120,121,122,123,144,145]};InputWaiter.prototype.get=function(){return document.getElementById("input-text").value},InputWaiter.prototype.set=function(a){document.getElementById("input-text").value=a,window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.setInputInfo=function(a,b){var c=a.toString().length;c=c<2?2:c;vard=Utils.pad(a.toString(),c,"").replace(//g," "),e=Utils.pad(b.toString(),c,"").replace(//g," ");document.getElementById("input-info").innerHTML="length: "+d+"<br>lines: "+e},InputWaiter.prototype.inputChange=function(a){this.manager.highlighter.removeHighlights(),this.app.progress=0;var b=this.get(),c=b.count("\n")+1;this.setInputInfo(b.length,c),this.badKeys.indexOf(a.keyCode)<0&&window.dispatchEvent(this.manager.statechange)},InputWaiter.prototype.inputDragover=function(a){return"move"!==a.dataTransfer.effectAllowed&&(a.stopPropagation(),a.preventDefault(),voida.target.classList.add("dropping-file"))},InputWaiter.prototype.inputDragleave=function(a){a.stopPropagation(),a.preventDefault(),a.target.classList.remove("dropping-file")},InputWaiter.prototype.inputDrop=function(a){if("move"===a.dataTransfer.effectAllowed)return!1;a.stopPropagation(),a.preventDefault();varb=a.target,c=a.dataTransfer.files[0],d=a.dataTransfer.getData("Text"),e=newFileReader,f="",g=0,h=20480,i=function(){f.length>1e5&&this.app.autoBake_&&(this.manager.controls.setAutoBake(!1),this.app.alert("Turned off Auto Bake as the input is large","warning",5e3)),this.set(f);var a=this.app.getRecipeConfig();a[0]&&"From Hex"===a[0].op||(a.unshift({op:"From Hex",args:["Space"]}),this.app.setRecipeConfig(a)),b.classList.remove("loadingFile")}.bind(this),j=function(){if(g>=c.size)return void i();b.value="Processing... "+Math.round(g/c.size*100)+"%";var a=c.slice(g,g+h);e.readAsArrayBuffer(a)};e.onload=function(a){var b=new Uint8Array(e.result);f+=Utils.toHexFast(b),g+=h,j()},b.classList.remove("dropping-file"),c?(b.classList.add("loadingFile"),j()):d&&this.set(d)},InputWaiter.prototype.clearIoClick=function(){this.manager.highlighter.removeHighlights(),document.getElementById("input-text").value="",document.getElementById("output-text").value="",document.getElementById("input-info").innerHTML="",document.getElementById("output-info").innerHTML="",document.getElementById("input-selection-info").innerHTML="",document.getElementById("output-selection-info").innerHTML="",window.dispatchEvent(this.manager.statechange)};var Manager=function(a){this.app=a,this.appstart=new CustomEvent("appstart",{bubbles:!0}),this.operationadd=new CustomEvent("operationadd",{bubbles:!0}),this.operationremove=new CustomEvent("operationremove",{bubbles:!0}),this.oplistcreate=new CustomEvent("oplistcreate",{bubbles:!0}),this.statechange=new CustomEvent("statechange",{bubbles:!0}),this.window=new WindowWaiter(this.app),this.controls=new ControlsWaiter(this.app,this),this.recipe=new RecipeWaiter(this.app,this),this.ops=new OperationsWaiter(this.app,this),this.input=new InputWaiter(this.app,this),this.output=new OutputWaiter(this.app,this),this.options=new OptionsWaiter(this.app),this.highlighter=new HighlighterWaiter(this.app),this.seasonal=new SeasonalWaiter(this.app,this),this.dynamicHandlers={},this.initialiseEventListeners()};Manager.prototype.setup=function(){this.recipe.initialiseOperationDragNDrop(),this.controls.autoBakeChange(),this.seasonal.load()},Manager.prototype.initialiseEventListeners=function(){window.addEventListener("resize",this.window.windowResize.bind(this.window)),window.addEventListener("blur",this.window.windowBlur.bind(this.window)),window.addEventListener("focus",this.window.windowFocus.b