Last active
January 3, 2016 07:09
-
-
Save 19h/8427312 to your computer and use it in GitHub Desktop.
Buzz5 Hashing Algorithm. Idea by @mrhanky17. Generates a hash from a md5 hash consisting of NSA buzzwords. Output may differ per engine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hash = function (seed) { | |
seed = seed || 123456789; | |
var r = function (m_w) { | |
var m_w = m_w || 123456789; | |
var m_z = 987654321; | |
var mask = 0xffffffff; | |
return function () { | |
m_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask; | |
m_w = (18000 * (m_w & 65535) + (m_w >> 16)) & mask; | |
var result = ((m_z << 16) + m_w) & mask; | |
result /= 4294967296; | |
return result + 0.5; | |
} | |
}; | |
var rnd = r(seed); | |
var bwords = "DefensiveInformation,DefenseInformationWarfare,OffensiveInformation,OffensiveInformationWarfare,TheArtfulDodger,NAIA,SAPM,ASU,ASTS,NationalInformationInfrastructure,InfoSec,SAO,Reno,Compsec,JICS,ComputerTerrorism,Firewalls,SecureInternetConnections,RSP,ISS,JDF,Ermes,Passwords,NAAP,DefConV,RSO,Hackers,Encryption,ASWS,CUN,CISU,CUSI,M.A.R.E.,MARE,UFO,IFO,Pacini,Angela,Espionage,USDOJ,NSA,CIA,S/Key,SSL,FBI,SecertService,USSS,Defcon,Military,WhiteHouse,Undercover,NCCS,Mayfly,PGP,SALDV,PEM,resta,RSA,Perl-RSA,MSNBC,bet,AOL,AOLTOS,CIS,CBOT,AIMSX,STARLAN,3B2,BITNET,SAMU,COSMOS,DATTA,Furbys,E911,FCIC,HTCIA,IACIS,UT/RUS,JANET,ram,JICC,ReMOB,LEETAC,UTU,VNET,BRLO,SADCC,NSLEP,SACLANTCEN,FALN,877,NAVELEXSYSSECENGCEN,BZ,CANSLO,CBNRC,CIDA,JAVA,rsta,ActiveX,Compsec97,RENS,LLC,DERA,JIC,rip,rb,Wu,RDI,Mavricks,BIOL,Meta-hackers,^?,SADT,SteveCase,Tools,RECCEX,Telex,Aldergrove,OTAN,monarchist,NMIC,NIOG,IDB,MID/KL,NADIS,NMI,SEIDM,BNC,CNCIS,STEEPLEBUSH,RG,BSS,DDIS,mixmaster,BCCI,BRGE,Europol,SARL,MilitaryIntelligence,JICA,Scully,recondo,Flame,Infowar,FRU,Bubba,Freeh,Archives,ISADC,CISSP,Sundevil,jack,Investigation,JOTS,ISACA,NCSA,ASVC,spookwords,RRF,1071,BugsBunny,Verisign,Secure,ASIO,Lebed,ICE,NRO,Lexis-Nexis,NSCT,SCIF,FLiR,JIC,bce,Lacrosse,Flashbangs,HRT,IRA,EODG,DIA,USCOI,CID,BOP,FINCEN,FLETC,NIJ,ACC,AFSPC,BMDO,site,SASSTIXS,NAVWAN,NRL,RL,NAVWCWPNS,NSWC,USAFA,AHPCRC,ARPA,SARD,LABLINK,USACIL,SAPT,USCG,NRC,~,O,NSA/CSS,CDC,DOE,SAAM,FMS,HPCC,NTIS,SEL,USCODE,CISE,SIRC,CIM,ISN,DJC,LLNL,bemd,SGC,UNCPCJ,CFC,SABENA,DREO,CDA,SADRS,DRA,SHAPE,birddog,SACLANT,BECCA,DCJFTF,HALO,SC,TASAS,Lander,GSM,TBranch,AST,SAMCOMM,HAHO,FKS,868,GCHQ,DITSA,SORT,AMEMB,NSG,HIC,EDI,benelux,SAS,SBS,SAW,UDT,EODC,GOE,DOE,SAMF,GEO,JRB,3P-HV,Masuda,Forte,AT,GIGN,ExonShell,radint,MB,CQB,TECS,CONUS,CTU,RCMP,GRU,SASR,GSG-9,22ndSAS,GEOS,EADA,SART,BBE,STEP,Echelon,Dictionary,MD2,MD4,MDA,diwn,747,ASIC,777,RDI,767,MI5,737,MI6,757,Kh-11,EODN,SHS,^X,Shayet-13,SADMS,Spetznaz,Recce,707,CIO,NOCS,Halcon,NSS,Duress,RAID,Uziel,wojo,Psyops,SASCOM,grom,NSIRL,D-11,DF,ZARK,SERT,VIP,ARC,S.E.T.Team,NSWG,MP5k,SATKA,DREC,DEVGRP,DSD,FDM,GRU,LRTS,SIGDEV,NACSI,MEU/SOC,PSAC,PTT,RFI,ZL31,SIGDASYS,TDM.SUKLO,Schengen,SUSLO,TELINT,fake,TEXTA.ELF,LF,MF,Mafia,JASSM,CALCM,TLAM,Wipeout,GII,SIW,MEII,C2W,Burns,Tomlinson,UfologicoNazionale,Centro,CICAP,MIR,Belknap,Tac,rebels,BLU-97A/B,007,nowhere.ch,bronze,Rubin,Arnett,BLU,SIGS,VHF,Recon,peapod,PA598D28,Spall,dort,50MZ,11EmcChoe,SATCOMA,UHF,TheHague,SHF,ASIO,SASP,WANK,Colonel,domesticdisruption,5ESS,smuggle,Z-200,15kg,DUVDEVAN,RFX,nitrate,OIR,Pretoria,M-14,enigma,BletchleyPark,Clandestine,NSO,nkvd,argus,afsatcom,CQB,NVD,CounterTerrorismSecurity,EnemyoftheState,SARA,RapidReaction,JSOFC3IP,CorporateSecurity,192.47.242.7,Baldwin,Wilma,ie.org,cospo.osis.gov,Police,Dateline,Tyrell,KMI,1ee,Pod,9705SamfordRoad,20755-6000,sniper,PPS,ASIS,ASLET,TSCM,SecurityConsulting,M-xspook,Z-150T,SteakKnife,HighSecurity,SecurityEvaluation,ElectronicSurveillance,MI-17,ISR,NSAS,Counterterrorism,real,spies,IWO,eavesdropping,debugging,CCSS,interception,COCOT,NACSI,rhost,rhosts,ASO,SETA,Amherst,Broadside,Capricorn,NAVCM,Gamma,Gorizont,Guppy,NSS,rita,ISSO,submiss,ASDIC,.tc,2EMEREP,FID,7NLSBS,tekka,captain,226,.45,nonac,.li,TonyPoe,MJ-12,JASON,Society,Hmong,Majic,evil,zipgun,tax,bootleg,warez,TRV,ERV,rednoise,mindwar,nailbomb,VLF,ULF,Paperclip,Chatter,MKULTRA,MKDELTA,Bluebird,MKNAOMI,WhiteYankee,MKSEARCH,355ML,Adriatic,Goldman,Ionosphere,Mole,Keyhole,NABS,Kilderkin,Artichoke,Badger,Emerson,Tzvrif,SDIS,T2S2,STTC,DNR,NADDIS,NFLIS,CFD,BLU-114/B,quarter,Cornflower,Daisy,Egret,Iris,JSOTF,Hollyhock,Jasmine,Juile,Vinnell,B.D.M.,Sphinx,Stephanie,Reflection,Spoke,Talent,Trump,FX,FXR,IMF,POCSAG,rusers,CovertVideo,Intiso,r00t,lockpicking,BeyondHope,LASINT,csystems,.tm,passwd,2600Magazine,JUWTF,Competitor,EO,Chan,Pathfinders,SEALTeam3,JTF,Nash,ISSAA,B61-11,Alouette,executive,EventSecurity,Mace,Cap-Stun,stakeout,ninja,ASIS,ISA,EOD,Oscor,Tarawa,COSMOS-2224,COSTIND,hitword,hitword,Hitwords,Regli,VBS,Leuken-Baden,numberkey,Zimmerwald,DDPS,GRS,AGT.AMME,ANDVT,TypeI,TypeII,VFCT,VGPL,WHCA,WSA,WSP,WWABNCP,ZNI1,FSK,FTS2000,GOSIP,GOTS,SACSSTU-III,PRF,PMSP,PCMT,I&A,JRSC,ITSDN,Keyer,KG-84C,KWT-46,KWR-46,KY-75,KYV-5,LHR,PARKHILL,LDMX,LEASAT,SNS,SVN,TACSAT,TRANSEC,DONCAF,EAM,DSCS,DSNET1,DSNET2,DSNET3,ECCM,EIP,EKMS,EKMC,DDN,DDP,Merlin,NTT,SL-1,Rolm,TIE,Tie-fighter,PBX,SLI,NTT,MSCJ,MIT,69,RIT,Time,MSEE,Cable&Wireless,CSE,SUW,J2,Embassy,ETA,Porno,Fax,finks,Faxencryption,whitenoise,Fernspah,MYK,GAFE,forcast,import,rain,tiger,buzzer,N9,pinknoise,CRA,M.P.R.I.,topsecret,Mossberg,50BMG,MacintoshSecurity,MacintoshInternetSecurity,OC3,MacintoshFirewalls,UnixSecurity,VIPProtection,SIG,sweep,Medco,TRD,TDR,Z,sweeping,SURSAT,5926,TELINT,Audiotel,Harvard,1080H,SWS,Asset,Satelliteimagery,force,NAIAG,Cypherpunks,NARF,127,Coderpunks,TRW,remailers,replay,redheads,RX-7,explicit,FLAME,J-6,Pornstars,AVN,Playboy,ISSSP,Anonymous,W,Sex,chaining,codes,Nuclear,20,subversives,SLIP,toad,fish,datahavens,unix,c,a,b,d,SUBACS,the,Elvis,quiche,DES,1*,N-ISDN,NLSP,OTAR,OTAT,OTCIXS,MISSI,MOSAIC,NAVCOMPARS,NCTS,NESP,MILSATCOM,AUTODIN,BLACKER,C3I,C4I,CMS,CMW,CP,SBU,SCCN,SITOR,SHF/DOD,FinksburgMD,Link16,LATA,NATIA,NATOA,sneakers,UXO,(),OC-12,counterintelligence,Shaldag,sport,NASA,TWA,DT,gtegsc,nowhere,.ch,hope,emc,industrialespionage,SUPIR,PI,TSCI,spookwords,industrialintelligence,H.N.P.,SUAEWICS,JuiliettClassSubmarine,Locks,qrss,loch,64VauxhallCross,IngramMac-10,wwics,sigvoice,ssa,E.O.D.,SEMTEX,penrep,racal,OTP,OSS,Siemens,RPC,Met,CIA-DST,INI,watchers,keebler,contacts,Blowpipe,BTM,CCS,GSA,KiloClass,squib,primacord,RSP,Z7,Becker,Nerd,fangs,Austin,no|d,Comirex,GPMG,Speakeasy,humint,GEODSS,SORO,M5,BROMURE,ANC,zone,SBI,DSS,S.A.I.C.,Minox,Keyhole,SAR,RandCorporation,Starr,Wackenhutt,EO,burhop,Wackendude,mol,Shelton,2E781,F-22,2010,JCET,cocaine,Vale,IG,Kosovo,Dake,36,800,Hillal,Pesec,Hindawi,GGL,NAICC,CTU,botux,Virii,CCC,ISPE,CCSC,Scud,SecDef,Magdeyev,VOA,Kosiura,SmallPox,Tajik,+=,Blacklisted411,TRDL,InternetUnderground,BX,XS4ALL,wetsu,muezzin,RetinalFetish,WIR,Fetish,FCA,Yobie,forschung,emm,ANZUS,Reprieve,NZC-332,edition,cards,mania,701,CTP,CATO,Phon-e,ChicagoPosse,NSDM,l0ck,beanpole,spook,keywords,QRR,PLA,TDYC,W3,CUD,CdC,WeeklyWorldNews,Zen,WorldDomination,Dead,GRU,M72750,Salsa,7,Blowfish,Gorelick,Glock,Ft.Meade,NSWT,press-release,WISDIM,burned,Indigo,wiretransfer,e-cash,BubbatheLoveSponge,Enforcers,Digicash,zip,SWAT,Ortega,PPP,NACSE,crypto-anarchy,AT&T,SGI,SUN,MCI,Blacknet,ISM,JCE,Middleman,KLM,Blackbird,NSV,GQ360,X400,Texas,jihad,SDI,BRIGAND,Uzi,FortMeade,*&,gchq.gov.uk,supercomputer,bullion,3,NTTC,Blackmednet,:,Propaganda,ABC,Satellitephones,IWIS,Planet-1,ISTA,rs9512c,JiangZemin,SouthAfrica,Sergeyev,Montenegro,Toeffler,Rebollo,sorot,YuccaMountain,FARC,Toth,XuYongyue,Bach,Razor,AC,cryptanalysis,nuclear,5252N-0303W,Morgan,Canine,GEBA,INSCOM,MEMEX,Stanley,FBI,Panama,fissionable,SearsTower,NORAD,DeltaForce,SEAL,virtual,WASS,WID,Dolch,secureshell,screws,Black-Ops,O/S,Area51,SABC,basement,ISWG,$@,data-haven,NSDD,black-bag,rack,TEMPEST,Goodwin,rebels,ID,MD5,IDEA,garbage,market,beef,Stego,ISAF,unclassified,SayeretTzanhanim,PARASAR,Gripan,pirg,curly,Taiwan,guest,utopia,NSG,orthodox,CCSQ,Alica,SHA,Global,gorilla,Bob,UNSCOM,Fukuyama,Manfurov,Kvashnin,Marx,Abdurahmon,snullen,Pseudonyms,MITM,NARF,GrayData,VLSI,mega,Leitrim,Yakima,NSES,SugarGrove,WAS,Cowboy,Gist,8182,Gatt,Platform,1911,Geraldton,UKUSA,veggie,XM,Parvus,NAVSVS,3848,Morwenstow,Consul,Oratory,PineGap,Menwith,Mantis,DSD,BVD,1984,blowout,BUDS,WQC,Flintlock,PABX,Electron,ChicagoCrust,e95,DDR&E,3M,KEDO,iButton,R1,erco,Toffler,FAS,RHL,K3,Visa/BCC,SNT,Ceridian,STE,condor,CipherTAC-2000,Etacs,Shipiro,ssor,piz,fritz,KY,32,Edens,Kiwis,Kamumaruha,DODIG,Firefly,HRM,Albright,Bellcore,rail,csim,NMS,2c,FIPS140-1,CAVE,E-Bomb,CDMA,Fortezza,355ml,ISSC,cybercash,NAWAS,government,NSY,hate,speedbump,joe,illuminati,BOSS,Kourou,Misawa,Morse,HF,P415,ladylove,filofax,Gulf,lamma,Unit5707,SayeretMat'Kal,Unit669,SayeretGolani,Lanceros,Summercon,NSADS,president,ISFR,freedom,ISSO,walburn,DefconVI,DC6,Larson,P99,HERFpipe-bomb,2.3Oz.,cocaine,$,imapct,Roswell,ESN,COS,E.T.,creditcard,b9,fraud,ST1,assasinate,virus,ISCS,ISPR,anarchy,rogue,mailbomb,888,Chelsea,1997,Whitewater,MOD,York,plutonium,WilliamGates,clone,BATF,SGDN,Nike,WWSV,Atlas,IWWSVCS,Delta,TWA,Kiwi,PGP2.6.2.,PGP5.0i,PGP5.1,siliconpimp,SASSTIXS,IWG,Lynch,414,Face,Pixar,IRIDF,NSRB,eternityserver,Skytel,Yukon,Templeton,Johohonbu,LUK,Cohiba,Soros,Standford,niche,ISEP,ISEC,51,H&K,USP,^,sardine,bank,EUB,USP,PCS,NRO,RedCell,NSOF,DC7,Glock26,snuffle,Patel,package,ISI,INR,INS,GRU,RUOP,GSS,NSP,SRI,Ronco,Armani,BOSS,Chobetsu,FBIS,BND,SISDE,FSB,BfV,IB,froglegs,JITEM,SADF,advise,TUSA,LITE,PKK,HoHoCon,SISMI,ISG,FIS,MSW,Spyderco,UOP,SSCI,NIMA,HAMASMOIS,SVR,SIN,advisors,SAP,Monica,OAU,PFS,Aladdin,AG,chameleonman,Hutsul,CESID,Bess,railgun,.375,Peering,CSC,TangimoanaBeach,Commecen,Vanuatu,Kwajalein,LHI,DRM,GSGI,DST,MITI,JERTO,SDF,Koancho,Blenheim,Rivera,Kyudanki,varon,310,17,312,NB,CBM,CTP,Sardine,SBIRS,jaws,SGDN,ADIU,DEADBEEF,IDP,IDF,Halibut,SONANGOL,Flu,&,Loin,PGP5.53,meta,Faber,SFPD,EG&G,ISEP,blackjack,Fox,Aum,AIEWS,AMW,RHL,Baranyi,WORM,MP5K-SD,1071,WINGS,cdi,VIA,DynCorp,UXO,Ti,WWSP,WID,osco,Mary,honor,Templar,THAAD,package,CISD,ISG,BIOLWPN,JRA,ISB,ISDS,chosen,LBSD,van,schloss,secops,DCSS,DPSD,LIF,J-Star,PRIME,SURVIAC,telex,Analyzer,embassy,Golf,B61-7,Maple,Tokyo,ERR,SBU,Threat,JPL,Tess,SE,Alex,EPL,SPINTCOM,FOUO,ISS-ADP,Merv,Mexico,SUR,blocks,SO13,Rojdykarna,RSOC,USSBanner,S511,20755,airframe,jya.com,Furby,PECSENC,football,Agfa,3210,Crowell,moore,510,OADR,Smith,toffee,FIS,N5P6,EuroFed,SP4,shelter,CryptoAGCroatiannuclearFBIcolonelplutoniumOrtegaWaco".split(","); | |
// creates an elliptic curve around zero | |
bwords = bwords.sort(function () { | |
return (rnd() * 0xFFFF) - 32767.5 | |
}); | |
var h = function() { | |
var p = function(f, c) { | |
return f + c & 4294967295 | |
}, h = function(f, c, a, b, e, d) { | |
c = p(p(c, f), p(b, d)); | |
return p(c << e | c >>> 32 - e, a) | |
}, k = function(f, c, a, b, e, d, g) { | |
return h(c & a | ~c & b, f, c, e, d, g) | |
}, l = function(f, c, a, b, e, d, g) { | |
return h(c & b | a & ~b, f, c, e, d, g) | |
}, m = function(f, c, a, b, e, d, g) { | |
return h(a ^ (c | ~b), f, c, e, d, g) | |
}, n = function(f, c) { | |
var a = f[0], | |
b = f[1], | |
e = f[2], | |
d = f[3], | |
a = k(a, b, e, d, c[0], 7, -680876936), | |
d = k(d, a, b, e, c[1], 12, -389564586), | |
e = k(e, d, a, b, c[2], 17, 606105819), | |
b = k(b, e, d, a, c[3], 22, -1044525330), | |
a = k(a, b, e, d, c[4], 7, -176418897), | |
d = k(d, a, b, e, c[5], 12, 1200080426), | |
e = k(e, d, a, b, c[6], 17, -1473231341), | |
b = k(b, e, d, a, c[7], 22, -45705983), | |
a = k(a, b, e, d, c[8], 7, 1770035416), | |
d = k(d, a, b, e, c[9], 12, -1958414417), | |
e = k(e, d, a, b, c[10], 17, -42063), | |
b = k(b, e, d, a, c[11], 22, -1990404162), | |
a = k(a, b, e, d, c[12], 7, 1804603682), | |
d = k(d, a, b, e, c[13], 12, -40341101), | |
e = k(e, d, a, b, c[14], 17, -1502002290), | |
b = k(b, e, d, a, c[15], 22, 1236535329), | |
a = l(a, b, e, d, c[1], 5, -165796510), | |
d = l(d, a, b, e, c[6], 9, -1069501632), | |
e = l(e, d, a, b, c[11], 14, 643717713), | |
b = l(b, e, d, a, c[0], 20, -373897302), | |
a = l(a, b, e, d, c[5], 5, -701558691), | |
d = l(d, a, b, e, c[10], 9, 38016083), | |
e = l(e, d, a, b, c[15], 14, -660478335), | |
b = l(b, e, d, a, c[4], 20, -405537848), | |
a = l(a, b, e, d, c[9], 5, 568446438), | |
d = l(d, a, b, e, c[14], 9, -1019803690), | |
e = l(e, d, a, b, c[3], 14, -187363961), | |
b = l(b, e, d, a, c[8], 20, 1163531501), | |
a = l(a, b, e, d, c[13], 5, -1444681467), | |
d = l(d, a, b, e, c[2], 9, -51403784), | |
e = l(e, d, a, b, c[7], 14, 1735328473), | |
b = l(b, e, d, a, c[12], 20, -1926607734), | |
a = h(b ^ e ^ d, a, b, c[5], 4, -378558), | |
d = h(a ^ b ^ e, d, a, c[8], 11, -2022574463), | |
e = h(d ^ a ^ b, e, d, c[11], 16, 1839030562), | |
b = h(e ^ d ^ a, b, e, c[14], 23, -35309556), | |
a = h(b ^ e ^ d, a, b, c[1], | |
4, -1530992060), | |
d = h(a ^ b ^ e, d, a, c[4], 11, 1272893353), | |
e = h(d ^ a ^ b, e, d, c[7], 16, -155497632), | |
b = h(e ^ d ^ a, b, e, c[10], 23, -1094730640), | |
a = h(b ^ e ^ d, a, b, c[13], 4, 681279174), | |
d = h(a ^ b ^ e, d, a, c[0], 11, -358537222), | |
e = h(d ^ a ^ b, e, d, c[3], 16, -722521979), | |
b = h(e ^ d ^ a, b, e, c[6], 23, 76029189), | |
a = h(b ^ e ^ d, a, b, c[9], 4, -640364487), | |
d = h(a ^ b ^ e, d, a, c[12], 11, -421815835), | |
e = h(d ^ a ^ b, e, d, c[15], 16, 530742520), | |
b = h(e ^ d ^ a, b, e, c[2], 23, -995338651), | |
a = m(a, b, e, d, c[0], 6, -198630844), | |
d = m(d, a, b, e, c[7], 10, 1126891415), | |
e = m(e, d, a, b, c[14], 15, -1416354905), | |
b = m(b, e, d, a, c[5], | |
21, -57434055), | |
a = m(a, b, e, d, c[12], 6, 1700485571), | |
d = m(d, a, b, e, c[3], 10, -1894986606), | |
e = m(e, d, a, b, c[10], 15, -1051523), | |
b = m(b, e, d, a, c[1], 21, -2054922799), | |
a = m(a, b, e, d, c[8], 6, 1873313359), | |
d = m(d, a, b, e, c[15], 10, -30611744), | |
e = m(e, d, a, b, c[6], 15, -1560198380), | |
b = m(b, e, d, a, c[13], 21, 1309151649), | |
a = m(a, b, e, d, c[4], 6, -145523070), | |
d = m(d, a, b, e, c[11], 10, -1120210379), | |
e = m(e, d, a, b, c[2], 15, 718787259), | |
b = m(b, e, d, a, c[9], 21, -343485551); | |
f[0] = p(a, f[0]); | |
f[1] = p(b, f[1]); | |
f[2] = p(e, f[2]); | |
f[3] = p(d, f[3]) | |
}, s = function(f) { | |
var c = [], | |
a; | |
for (a = 0; 64 > a; a += | |
4) c[a >> 2] = f.charCodeAt(a) + (f.charCodeAt(a + 1) << 8) + (f.charCodeAt(a + 2) << 16) + (f.charCodeAt(a + 3) << 24); | |
return c | |
}, t = function(f) { | |
var c = [], | |
a; | |
for (a = 0; 64 > a; a += 4) c[a >> 2] = f[a] + (f[a + 1] << 8) + (f[a + 2] << 16) + (f[a + 3] << 24); | |
return c | |
}, r = function(f) { | |
var c = f.length, | |
a = [1732584193, -271733879, -1732584194, 271733878], | |
b, e, d; | |
for (b = 64; b <= c; b += 64) n(a, s(f.substring(b - 64, b))); | |
f = f.substring(b - 64); | |
e = f.length; | |
d = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; | |
for (b = 0; b < e; b += 1) d[b >> 2] |= f.charCodeAt(b) << (b % 4 << 3); | |
d[b >> 2] |= 128 << (b % 4 << 3); | |
if (55 < b) | |
for (n(a, d), | |
b = 0; 16 > b; b += 1) d[b] = 0; | |
c = (8 * c).toString(16).match(/(.*?)(.{0,8})$/); | |
f = parseInt(c[2], 16); | |
c = parseInt(c[1], 16) || 0; | |
d[14] = f; | |
d[15] = c; | |
n(a, d); | |
return a | |
}, u = "0123456789abcdef".split(""), | |
q = function(f) { | |
var c; | |
for (c = 0; c < f.length; c += 1) { | |
for (var a = f, b = c, e = f[c], d = "", g = void 0, g = 0; 4 > g; g += 1) d += u[e >> 8 * g + 4 & 15] + u[e >> 8 * g & 15]; | |
a[b] = d | |
} | |
return f.join("") | |
}; | |
g = function() { | |
this.reset() | |
}; | |
"5d41402abc4b2a76b9719d911017c592" !== q(r("hello")) && (p = function(f, c) { | |
var a = (f & 65535) + (c & 65535); | |
return (f >> 16) + (c >> 16) + (a >> 16) << 16 | a & 65535 | |
}); | |
g.prototype.append = | |
function(f) { | |
/[\u0080-\uFFFF]/.test(f) && (f = unescape(encodeURIComponent(f))); | |
this.appendBinary(f); | |
return this | |
}; | |
g.prototype.appendBinary = function(f) { | |
this._buff += f; | |
this._length += f.length; | |
f = this._buff.length; | |
var c; | |
for (c = 64; c <= f; c += 64) n(this._state, s(this._buff.substring(c - 64, c))); | |
this._buff = this._buff.substr(c - 64); | |
return this | |
}; | |
g.prototype.end = function(f) { | |
var c = this._buff, | |
a = c.length, | |
b, e = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; | |
for (b = 0; b < a; b += 1) e[b >> 2] |= c.charCodeAt(b) << (b % 4 << 3); | |
this._finish(e, a); | |
f = f ? this._state : | |
q(this._state); | |
this.reset(); | |
return f | |
}; | |
g.prototype._finish = function(f, c) { | |
var a = c, | |
b; | |
f[a >> 2] |= 128 << (a % 4 << 3); | |
if (55 < a) | |
for (n(this._state, f), a = 0; 16 > a; a += 1) f[a] = 0; | |
b = 8 * this._length; | |
b = b.toString(16).match(/(.*?)(.{0,8})$/); | |
a = parseInt(b[2], 16); | |
b = parseInt(b[1], 16) || 0; | |
f[14] = a; | |
f[15] = b; | |
n(this._state, f) | |
}; | |
g.prototype.reset = function() { | |
this._buff = ""; | |
this._length = 0; | |
this._state = [1732584193, -271733879, -1732584194, 271733878]; | |
return this | |
}; | |
g.prototype.destroy = function() { | |
delete this._state; | |
delete this._buff; | |
delete this._length | |
}; | |
g.hash = function(f, c) { | |
/[\u0080-\uFFFF]/.test(f) && (f = unescape(encodeURIComponent(f))); | |
var a = r(f); | |
return c ? a : q(a) | |
}; | |
g.hashBinary = function(f, c) { | |
var a = r(f); | |
return c ? a : q(a) | |
}; | |
g.ArrayBuffer = function() { | |
this.reset() | |
}; | |
g.ArrayBuffer.prototype.append = function(f) { | |
var c = this._concatArrayBuffer(this._buff, f), | |
a = c.length; | |
this._length += f.byteLength; | |
for (f = 64; f <= a; f += 64) n(this._state, t(c.subarray(f - 64, f))); | |
this._buff = f - 64 < a ? c.subarray(f - 64) : new Uint8Array(0); | |
return this | |
}; | |
g.ArrayBuffer.prototype.end = function(f) { | |
var c = this._buff, | |
a = c.length, | |
b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
e; | |
for (e = 0; e < a; e += 1) b[e >> 2] |= c[e] << (e % 4 << 3); | |
this._finish(b, a); | |
f = f ? this._state : q(this._state); | |
this.reset(); | |
return f | |
}; | |
g.ArrayBuffer.prototype._finish = g.prototype._finish; | |
g.ArrayBuffer.prototype.reset = function() { | |
this._buff = new Uint8Array(0); | |
this._length = 0; | |
this._state = [1732584193, -271733879, -1732584194, 271733878]; | |
return this | |
}; | |
g.ArrayBuffer.prototype.destroy = g.prototype.destroy; | |
g.ArrayBuffer.prototype._concatArrayBuffer = function(f, c) { | |
var a = f.length, | |
b = new Uint8Array(a + | |
c.byteLength); | |
b.set(f); | |
b.set(new Uint8Array(c), a); | |
return b | |
}; | |
g.ArrayBuffer.hash = function(f, c) { | |
var a = new Uint8Array(f), | |
b = a.length, | |
e = [1732584193, -271733879, -1732584194, 271733878], | |
d, g, h; | |
for (d = 64; d <= b; d += 64) n(e, t(a.subarray(d - 64, d))); | |
a = d - 64 < b ? a.subarray(d - 64) : new Uint8Array(0); | |
g = a.length; | |
h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; | |
for (d = 0; d < g; d += 1) h[d >> 2] |= a[d] << (d % 4 << 3); | |
h[d >> 2] |= 128 << (d % 4 << 3); | |
if (55 < d) | |
for (n(e, h), d = 0; 16 > d; d += 1) h[d] = 0; | |
b = (8 * b).toString(16).match(/(.*?)(.{0,8})$/); | |
a = parseInt(b[2], 16); | |
b = parseInt(b[1], | |
16) || 0; | |
h[14] = a; | |
h[15] = b; | |
n(e, h); | |
return c ? e : q(e) | |
}; | |
return g.hash | |
}(); | |
return function (str) { | |
var c = h(str).toString(16); | |
var y = []; | |
for ( var i = 0; i < c.length / 2; i += 2 ) | |
y.push(c[i] + c[i+1]) | |
return y.map(function (v) { | |
return bwords[parseInt(v, 16)] | |
}).join("") | |
} | |
} | |
var buzz5 = hash(); | |
console.log(buzz5("yolo")) // Merlinblack-bagDakecrypto-anarchyvanIDBISPRCFD | |
console.log(buzz5("yolos")) // RSPDC7TACSAT3P-HVMantisMaple15kgRL | |
var buzz5b = hash(0x1DAF0431); | |
console.log(buzz5b("yolo")) // UT/RUSMeta-hackers5252N-0303WASUE911InfoSecCESIDHackers | |
console.log(buzz5b("yolos")) // GistNATOABXWIRISTAASIOSatellitephonespackage | |
var buzz5c = hash(0xDEADBEEF); | |
console.log(buzz5c("yolo")) // IndigoCAVE32LEETACGAFEmailbombADIUVNET | |
console.log(buzz5c("yolos")) // plutoniumpress-releaseblocksIWOfangsSATKALebed11EmcChoe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment