[{"data":1,"prerenderedAt":1853},["ShallowReactive",2],{"blog:2007:calculating-elf-32-in-c-and-net":3,"blogMore-Development":1378,"comments-calculating-elf-32-in-c-and-net":1391},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"category":11,"tags":12,"excerpt":16,"body":38,"_type":1370,"_id":1371,"_source":1372,"_file":1373,"_stem":1374,"_extension":1375,"url":1376,"wordCount":1377,"minutes":104,"commentCount":148},"/blog/2007/calculating-elf-32-in-c-and-net","2007",false,"en","Calculating Elf-32 in C# and .NET","","2007-11-24T17:18:21+00:00","Development",[13,14,15],".NET","C#","hashing",{"type":17,"children":18},"root",[19,29],{"type":20,"tag":21,"props":22,"children":23},"element","p",{},[24,27],{"type":25,"value":26},"text","GitHub has the ",{"type":25,"value":28},"latest version of Elf32",{"type":20,"tag":21,"props":30,"children":31},{},[32,34,36],{"type":25,"value":33},"Because you can never have enough hashing algorithms at your disposal this one is compatible with the elf_hash function that forms part of the ",{"type":25,"value":35},"Executable and Linkable Format",{"type":25,"value":37},".",{"type":17,"children":39,"toc":1368},[40,56,67,1353,1362],{"type":20,"tag":41,"props":42,"children":43},"blockquote",{},[44],{"type":20,"tag":21,"props":45,"children":46},{},[47,48],{"type":25,"value":26},{"type":20,"tag":49,"props":50,"children":54},"a",{"href":51,"rel":52},"https://github.com/damieng/DamienGKit/blob/master/CSharp/DamienG.Library/Security/Cryptography/Elf32.cs",[53],"nofollow",[55],{"type":25,"value":28},{"type":20,"tag":21,"props":57,"children":58},{},[59,60,66],{"type":25,"value":33},{"type":20,"tag":49,"props":61,"children":64},{"href":62,"rel":63},"https://en.wikipedia.org/wiki/Executable_and_Linkable_Format",[53],[65],{"type":25,"value":35},{"type":25,"value":37},{"type":20,"tag":68,"props":69,"children":73},"pre",{"className":70,"code":71,"language":72,"meta":9,"style":9},"language-csharp shiki shiki-themes everforest-light dracula","using System;\nusing System.Security.Cryptography;\n\npublic class Elf32 : HashAlgorithm {\n  private UInt32 hash;\n\n  public Elf32() {\n    Initialize();\n  }\n\n  public override void Initialize() {\n    hash = 0;\n  }\n\n  protected override void HashCore(byte[] buffer, int start, int length) {\n    hash = CalculateHash(hash, buffer, start, length);\n  }\n\n  protected override byte[] HashFinal() {\n    byte[] hashBuffer = UInt32ToBigEndianBytes(hash);\n    this.HashValue = hashBuffer;\n    return hashBuffer;\n  }\n\n  public override int HashSize { get { return 32; } }\n\n  public static UInt32 Compute(UInt32 polynomial, UInt32 seed, byte[] buffer) {\n    return CalculateHash(seed, buffer, 0, buffer.Length);\n  }\n\n  private static UInt32 CalculateHash(UInt32 seed, byte[] buffer, int start, int size) {\n    UInt32 hash = seed;\n\n    for (int i = start; i \u003C size; i++)\n       unchecked {\n          hash = (hash \u003C\u003C 4) + buffer[i];\n          UInt32 work = (hash & 0xf0000000);\n          if (work != 0)\n             hash ^= (work >> 24);\n          hash &= ~work;\n       }\n    return hash;\n  }\n\n  private byte[] UInt32ToBigEndianBytes(UInt32 x) {\n    return new byte[] {\n       (byte)((x >> 24) & 0xff),\n       (byte)((x >> 16) & 0xff),\n       (byte)((x >> 8) & 0xff),\n       (byte)(x & 0xff)\n    };\n  }\n}\n","csharp",[74],{"type":20,"tag":75,"props":76,"children":77},"code",{"__ignoreMap":9},[78,102,136,146,183,202,210,229,243,252,260,288,312,320,328,404,426,434,442,472,500,530,543,551,559,606,614,683,720,728,736,813,836,844,896,909,957,993,1020,1052,1075,1084,1096,1104,1112,1150,1172,1216,1257,1298,1327,1336,1344],{"type":20,"tag":79,"props":80,"children":83},"span",{"class":81,"line":82},"line",1,[84,90,96],{"type":20,"tag":79,"props":85,"children":87},{"style":86},"--shiki-default:#F85552;--shiki-dark:#FF79C6",[88],{"type":25,"value":89},"using",{"type":20,"tag":79,"props":91,"children":93},{"style":92},"--shiki-default:#DF69BA;--shiki-default-font-style:inherit;--shiki-dark:#8BE9FD;--shiki-dark-font-style:italic",[94],{"type":25,"value":95}," System",{"type":20,"tag":79,"props":97,"children":99},{"style":98},"--shiki-default:#5C6A72;--shiki-dark:#F8F8F2",[100],{"type":25,"value":101},";\n",{"type":20,"tag":79,"props":103,"children":105},{"class":81,"line":104},2,[106,110,114,118,123,127,132],{"type":20,"tag":79,"props":107,"children":108},{"style":86},[109],{"type":25,"value":89},{"type":20,"tag":79,"props":111,"children":112},{"style":92},[113],{"type":25,"value":95},{"type":20,"tag":79,"props":115,"children":116},{"style":98},[117],{"type":25,"value":37},{"type":20,"tag":79,"props":119,"children":120},{"style":92},[121],{"type":25,"value":122},"Security",{"type":20,"tag":79,"props":124,"children":125},{"style":98},[126],{"type":25,"value":37},{"type":20,"tag":79,"props":128,"children":129},{"style":92},[130],{"type":25,"value":131},"Cryptography",{"type":20,"tag":79,"props":133,"children":134},{"style":98},[135],{"type":25,"value":101},{"type":20,"tag":79,"props":137,"children":139},{"class":81,"line":138},3,[140],{"type":20,"tag":79,"props":141,"children":143},{"emptyLinePlaceholder":142},true,[144],{"type":25,"value":145},"\n",{"type":20,"tag":79,"props":147,"children":149},{"class":81,"line":148},4,[150,156,161,167,172,178],{"type":20,"tag":79,"props":151,"children":153},{"style":152},"--shiki-default:#F57D26;--shiki-dark:#FF79C6",[154],{"type":25,"value":155},"public",{"type":20,"tag":79,"props":157,"children":158},{"style":86},[159],{"type":25,"value":160}," class",{"type":20,"tag":79,"props":162,"children":164},{"style":163},"--shiki-default:#3A94C5;--shiki-dark:#8BE9FD",[165],{"type":25,"value":166}," Elf32",{"type":20,"tag":79,"props":168,"children":169},{"style":98},[170],{"type":25,"value":171}," : ",{"type":20,"tag":79,"props":173,"children":175},{"style":174},"--shiki-default:#3A94C5;--shiki-default-font-style:inherit;--shiki-dark:#8BE9FD;--shiki-dark-font-style:italic",[176],{"type":25,"value":177},"HashAlgorithm",{"type":20,"tag":79,"props":179,"children":180},{"style":98},[181],{"type":25,"value":182}," {\n",{"type":20,"tag":79,"props":184,"children":186},{"class":81,"line":185},5,[187,192,197],{"type":20,"tag":79,"props":188,"children":189},{"style":152},[190],{"type":25,"value":191},"  private",{"type":20,"tag":79,"props":193,"children":194},{"style":174},[195],{"type":25,"value":196}," UInt32",{"type":20,"tag":79,"props":198,"children":199},{"style":98},[200],{"type":25,"value":201}," hash;\n",{"type":20,"tag":79,"props":203,"children":205},{"class":81,"line":204},6,[206],{"type":20,"tag":79,"props":207,"children":208},{"emptyLinePlaceholder":142},[209],{"type":25,"value":145},{"type":20,"tag":79,"props":211,"children":213},{"class":81,"line":212},7,[214,219,224],{"type":20,"tag":79,"props":215,"children":216},{"style":152},[217],{"type":25,"value":218},"  public",{"type":20,"tag":79,"props":220,"children":222},{"style":221},"--shiki-default:#8DA101;--shiki-dark:#50FA7B",[223],{"type":25,"value":166},{"type":20,"tag":79,"props":225,"children":226},{"style":98},[227],{"type":25,"value":228},"() {\n",{"type":20,"tag":79,"props":230,"children":232},{"class":81,"line":231},8,[233,238],{"type":20,"tag":79,"props":234,"children":235},{"style":221},[236],{"type":25,"value":237},"    Initialize",{"type":20,"tag":79,"props":239,"children":240},{"style":98},[241],{"type":25,"value":242},"();\n",{"type":20,"tag":79,"props":244,"children":246},{"class":81,"line":245},9,[247],{"type":20,"tag":79,"props":248,"children":249},{"style":98},[250],{"type":25,"value":251},"  }\n",{"type":20,"tag":79,"props":253,"children":255},{"class":81,"line":254},10,[256],{"type":20,"tag":79,"props":257,"children":258},{"emptyLinePlaceholder":142},[259],{"type":25,"value":145},{"type":20,"tag":79,"props":261,"children":263},{"class":81,"line":262},11,[264,268,273,279,284],{"type":20,"tag":79,"props":265,"children":266},{"style":152},[267],{"type":25,"value":218},{"type":20,"tag":79,"props":269,"children":270},{"style":152},[271],{"type":25,"value":272}," override",{"type":20,"tag":79,"props":274,"children":276},{"style":275},"--shiki-default:#3A94C5;--shiki-dark:#FF79C6",[277],{"type":25,"value":278}," void",{"type":20,"tag":79,"props":280,"children":281},{"style":221},[282],{"type":25,"value":283}," Initialize",{"type":20,"tag":79,"props":285,"children":286},{"style":98},[287],{"type":25,"value":228},{"type":20,"tag":79,"props":289,"children":291},{"class":81,"line":290},12,[292,297,302,308],{"type":20,"tag":79,"props":293,"children":294},{"style":98},[295],{"type":25,"value":296},"    hash ",{"type":20,"tag":79,"props":298,"children":299},{"style":152},[300],{"type":25,"value":301},"=",{"type":20,"tag":79,"props":303,"children":305},{"style":304},"--shiki-default:#DF69BA;--shiki-dark:#BD93F9",[306],{"type":25,"value":307}," 0",{"type":20,"tag":79,"props":309,"children":310},{"style":98},[311],{"type":25,"value":101},{"type":20,"tag":79,"props":313,"children":315},{"class":81,"line":314},13,[316],{"type":20,"tag":79,"props":317,"children":318},{"style":98},[319],{"type":25,"value":251},{"type":20,"tag":79,"props":321,"children":323},{"class":81,"line":322},14,[324],{"type":20,"tag":79,"props":325,"children":326},{"emptyLinePlaceholder":142},[327],{"type":25,"value":145},{"type":20,"tag":79,"props":329,"children":331},{"class":81,"line":330},15,[332,337,341,345,350,355,360,365,371,376,381,386,390,394,399],{"type":20,"tag":79,"props":333,"children":334},{"style":152},[335],{"type":25,"value":336},"  protected",{"type":20,"tag":79,"props":338,"children":339},{"style":152},[340],{"type":25,"value":272},{"type":20,"tag":79,"props":342,"children":343},{"style":275},[344],{"type":25,"value":278},{"type":20,"tag":79,"props":346,"children":347},{"style":221},[348],{"type":25,"value":349}," HashCore",{"type":20,"tag":79,"props":351,"children":352},{"style":98},[353],{"type":25,"value":354},"(",{"type":20,"tag":79,"props":356,"children":357},{"style":275},[358],{"type":25,"value":359},"byte",{"type":20,"tag":79,"props":361,"children":362},{"style":98},[363],{"type":25,"value":364},"[] ",{"type":20,"tag":79,"props":366,"children":368},{"style":367},"--shiki-default:#5C6A72;--shiki-default-font-style:inherit;--shiki-dark:#FFB86C;--shiki-dark-font-style:italic",[369],{"type":25,"value":370},"buffer",{"type":20,"tag":79,"props":372,"children":373},{"style":98},[374],{"type":25,"value":375},", ",{"type":20,"tag":79,"props":377,"children":378},{"style":275},[379],{"type":25,"value":380},"int",{"type":20,"tag":79,"props":382,"children":383},{"style":367},[384],{"type":25,"value":385}," start",{"type":20,"tag":79,"props":387,"children":388},{"style":98},[389],{"type":25,"value":375},{"type":20,"tag":79,"props":391,"children":392},{"style":275},[393],{"type":25,"value":380},{"type":20,"tag":79,"props":395,"children":396},{"style":367},[397],{"type":25,"value":398}," length",{"type":20,"tag":79,"props":400,"children":401},{"style":98},[402],{"type":25,"value":403},") {\n",{"type":20,"tag":79,"props":405,"children":407},{"class":81,"line":406},16,[408,412,416,421],{"type":20,"tag":79,"props":409,"children":410},{"style":98},[411],{"type":25,"value":296},{"type":20,"tag":79,"props":413,"children":414},{"style":152},[415],{"type":25,"value":301},{"type":20,"tag":79,"props":417,"children":418},{"style":221},[419],{"type":25,"value":420}," CalculateHash",{"type":20,"tag":79,"props":422,"children":423},{"style":98},[424],{"type":25,"value":425},"(hash, buffer, start, length);\n",{"type":20,"tag":79,"props":427,"children":429},{"class":81,"line":428},17,[430],{"type":20,"tag":79,"props":431,"children":432},{"style":98},[433],{"type":25,"value":251},{"type":20,"tag":79,"props":435,"children":437},{"class":81,"line":436},18,[438],{"type":20,"tag":79,"props":439,"children":440},{"emptyLinePlaceholder":142},[441],{"type":25,"value":145},{"type":20,"tag":79,"props":443,"children":445},{"class":81,"line":444},19,[446,450,454,459,463,468],{"type":20,"tag":79,"props":447,"children":448},{"style":152},[449],{"type":25,"value":336},{"type":20,"tag":79,"props":451,"children":452},{"style":152},[453],{"type":25,"value":272},{"type":20,"tag":79,"props":455,"children":456},{"style":275},[457],{"type":25,"value":458}," byte",{"type":20,"tag":79,"props":460,"children":461},{"style":98},[462],{"type":25,"value":364},{"type":20,"tag":79,"props":464,"children":465},{"style":221},[466],{"type":25,"value":467},"HashFinal",{"type":20,"tag":79,"props":469,"children":470},{"style":98},[471],{"type":25,"value":228},{"type":20,"tag":79,"props":473,"children":475},{"class":81,"line":474},20,[476,481,486,490,495],{"type":20,"tag":79,"props":477,"children":478},{"style":275},[479],{"type":25,"value":480},"    byte",{"type":20,"tag":79,"props":482,"children":483},{"style":98},[484],{"type":25,"value":485},"[] hashBuffer ",{"type":20,"tag":79,"props":487,"children":488},{"style":152},[489],{"type":25,"value":301},{"type":20,"tag":79,"props":491,"children":492},{"style":221},[493],{"type":25,"value":494}," UInt32ToBigEndianBytes",{"type":20,"tag":79,"props":496,"children":497},{"style":98},[498],{"type":25,"value":499},"(hash);\n",{"type":20,"tag":79,"props":501,"children":503},{"class":81,"line":502},21,[504,510,514,520,525],{"type":20,"tag":79,"props":505,"children":507},{"style":506},"--shiki-default:#DF69BA;--shiki-default-font-style:inherit;--shiki-dark:#BD93F9;--shiki-dark-font-style:italic",[508],{"type":25,"value":509},"    this",{"type":20,"tag":79,"props":511,"children":512},{"style":98},[513],{"type":25,"value":37},{"type":20,"tag":79,"props":515,"children":517},{"style":516},"--shiki-default:#35A77C;--shiki-dark:#F8F8F2",[518],{"type":25,"value":519},"HashValue",{"type":20,"tag":79,"props":521,"children":522},{"style":152},[523],{"type":25,"value":524}," =",{"type":20,"tag":79,"props":526,"children":527},{"style":98},[528],{"type":25,"value":529}," hashBuffer;\n",{"type":20,"tag":79,"props":531,"children":533},{"class":81,"line":532},22,[534,539],{"type":20,"tag":79,"props":535,"children":536},{"style":86},[537],{"type":25,"value":538},"    return",{"type":20,"tag":79,"props":540,"children":541},{"style":98},[542],{"type":25,"value":529},{"type":20,"tag":79,"props":544,"children":546},{"class":81,"line":545},23,[547],{"type":20,"tag":79,"props":548,"children":549},{"style":98},[550],{"type":25,"value":251},{"type":20,"tag":79,"props":552,"children":554},{"class":81,"line":553},24,[555],{"type":20,"tag":79,"props":556,"children":557},{"emptyLinePlaceholder":142},[558],{"type":25,"value":145},{"type":20,"tag":79,"props":560,"children":562},{"class":81,"line":561},25,[563,567,571,576,581,586,591,596,601],{"type":20,"tag":79,"props":564,"children":565},{"style":152},[566],{"type":25,"value":218},{"type":20,"tag":79,"props":568,"children":569},{"style":152},[570],{"type":25,"value":272},{"type":20,"tag":79,"props":572,"children":573},{"style":275},[574],{"type":25,"value":575}," int",{"type":20,"tag":79,"props":577,"children":578},{"style":98},[579],{"type":25,"value":580}," HashSize { ",{"type":20,"tag":79,"props":582,"children":583},{"style":275},[584],{"type":25,"value":585},"get",{"type":20,"tag":79,"props":587,"children":588},{"style":98},[589],{"type":25,"value":590}," { ",{"type":20,"tag":79,"props":592,"children":593},{"style":86},[594],{"type":25,"value":595},"return",{"type":20,"tag":79,"props":597,"children":598},{"style":304},[599],{"type":25,"value":600}," 32",{"type":20,"tag":79,"props":602,"children":603},{"style":98},[604],{"type":25,"value":605},"; } }\n",{"type":20,"tag":79,"props":607,"children":609},{"class":81,"line":608},26,[610],{"type":20,"tag":79,"props":611,"children":612},{"emptyLinePlaceholder":142},[613],{"type":25,"value":145},{"type":20,"tag":79,"props":615,"children":617},{"class":81,"line":616},27,[618,622,627,631,636,640,645,650,654,658,663,667,671,675,679],{"type":20,"tag":79,"props":619,"children":620},{"style":152},[621],{"type":25,"value":218},{"type":20,"tag":79,"props":623,"children":624},{"style":152},[625],{"type":25,"value":626}," static",{"type":20,"tag":79,"props":628,"children":629},{"style":174},[630],{"type":25,"value":196},{"type":20,"tag":79,"props":632,"children":633},{"style":221},[634],{"type":25,"value":635}," Compute",{"type":20,"tag":79,"props":637,"children":638},{"style":98},[639],{"type":25,"value":354},{"type":20,"tag":79,"props":641,"children":642},{"style":174},[643],{"type":25,"value":644},"UInt32",{"type":20,"tag":79,"props":646,"children":647},{"style":367},[648],{"type":25,"value":649}," polynomial",{"type":20,"tag":79,"props":651,"children":652},{"style":98},[653],{"type":25,"value":375},{"type":20,"tag":79,"props":655,"children":656},{"style":174},[657],{"type":25,"value":644},{"type":20,"tag":79,"props":659,"children":660},{"style":367},[661],{"type":25,"value":662}," seed",{"type":20,"tag":79,"props":664,"children":665},{"style":98},[666],{"type":25,"value":375},{"type":20,"tag":79,"props":668,"children":669},{"style":275},[670],{"type":25,"value":359},{"type":20,"tag":79,"props":672,"children":673},{"style":98},[674],{"type":25,"value":364},{"type":20,"tag":79,"props":676,"children":677},{"style":367},[678],{"type":25,"value":370},{"type":20,"tag":79,"props":680,"children":681},{"style":98},[682],{"type":25,"value":403},{"type":20,"tag":79,"props":684,"children":686},{"class":81,"line":685},28,[687,691,695,700,705,710,715],{"type":20,"tag":79,"props":688,"children":689},{"style":86},[690],{"type":25,"value":538},{"type":20,"tag":79,"props":692,"children":693},{"style":221},[694],{"type":25,"value":420},{"type":20,"tag":79,"props":696,"children":697},{"style":98},[698],{"type":25,"value":699},"(seed, buffer, ",{"type":20,"tag":79,"props":701,"children":702},{"style":304},[703],{"type":25,"value":704},"0",{"type":20,"tag":79,"props":706,"children":707},{"style":98},[708],{"type":25,"value":709},", buffer.",{"type":20,"tag":79,"props":711,"children":712},{"style":516},[713],{"type":25,"value":714},"Length",{"type":20,"tag":79,"props":716,"children":717},{"style":98},[718],{"type":25,"value":719},");\n",{"type":20,"tag":79,"props":721,"children":723},{"class":81,"line":722},29,[724],{"type":20,"tag":79,"props":725,"children":726},{"style":98},[727],{"type":25,"value":251},{"type":20,"tag":79,"props":729,"children":731},{"class":81,"line":730},30,[732],{"type":20,"tag":79,"props":733,"children":734},{"emptyLinePlaceholder":142},[735],{"type":25,"value":145},{"type":20,"tag":79,"props":737,"children":739},{"class":81,"line":738},31,[740,744,748,752,756,760,764,768,772,776,780,784,788,792,796,800,804,809],{"type":20,"tag":79,"props":741,"children":742},{"style":152},[743],{"type":25,"value":191},{"type":20,"tag":79,"props":745,"children":746},{"style":152},[747],{"type":25,"value":626},{"type":20,"tag":79,"props":749,"children":750},{"style":174},[751],{"type":25,"value":196},{"type":20,"tag":79,"props":753,"children":754},{"style":221},[755],{"type":25,"value":420},{"type":20,"tag":79,"props":757,"children":758},{"style":98},[759],{"type":25,"value":354},{"type":20,"tag":79,"props":761,"children":762},{"style":174},[763],{"type":25,"value":644},{"type":20,"tag":79,"props":765,"children":766},{"style":367},[767],{"type":25,"value":662},{"type":20,"tag":79,"props":769,"children":770},{"style":98},[771],{"type":25,"value":375},{"type":20,"tag":79,"props":773,"children":774},{"style":275},[775],{"type":25,"value":359},{"type":20,"tag":79,"props":777,"children":778},{"style":98},[779],{"type":25,"value":364},{"type":20,"tag":79,"props":781,"children":782},{"style":367},[783],{"type":25,"value":370},{"type":20,"tag":79,"props":785,"children":786},{"style":98},[787],{"type":25,"value":375},{"type":20,"tag":79,"props":789,"children":790},{"style":275},[791],{"type":25,"value":380},{"type":20,"tag":79,"props":793,"children":794},{"style":367},[795],{"type":25,"value":385},{"type":20,"tag":79,"props":797,"children":798},{"style":98},[799],{"type":25,"value":375},{"type":20,"tag":79,"props":801,"children":802},{"style":275},[803],{"type":25,"value":380},{"type":20,"tag":79,"props":805,"children":806},{"style":367},[807],{"type":25,"value":808}," size",{"type":20,"tag":79,"props":810,"children":811},{"style":98},[812],{"type":25,"value":403},{"type":20,"tag":79,"props":814,"children":816},{"class":81,"line":815},32,[817,822,827,831],{"type":20,"tag":79,"props":818,"children":819},{"style":174},[820],{"type":25,"value":821},"    UInt32",{"type":20,"tag":79,"props":823,"children":824},{"style":98},[825],{"type":25,"value":826}," hash ",{"type":20,"tag":79,"props":828,"children":829},{"style":152},[830],{"type":25,"value":301},{"type":20,"tag":79,"props":832,"children":833},{"style":98},[834],{"type":25,"value":835}," seed;\n",{"type":20,"tag":79,"props":837,"children":839},{"class":81,"line":838},33,[840],{"type":20,"tag":79,"props":841,"children":842},{"emptyLinePlaceholder":142},[843],{"type":25,"value":145},{"type":20,"tag":79,"props":845,"children":847},{"class":81,"line":846},34,[848,853,858,862,867,871,876,881,886,891],{"type":20,"tag":79,"props":849,"children":850},{"style":86},[851],{"type":25,"value":852},"    for",{"type":20,"tag":79,"props":854,"children":855},{"style":98},[856],{"type":25,"value":857}," (",{"type":20,"tag":79,"props":859,"children":860},{"style":275},[861],{"type":25,"value":380},{"type":20,"tag":79,"props":863,"children":864},{"style":98},[865],{"type":25,"value":866}," i ",{"type":20,"tag":79,"props":868,"children":869},{"style":152},[870],{"type":25,"value":301},{"type":20,"tag":79,"props":872,"children":873},{"style":98},[874],{"type":25,"value":875}," start; i ",{"type":20,"tag":79,"props":877,"children":878},{"style":152},[879],{"type":25,"value":880},"\u003C",{"type":20,"tag":79,"props":882,"children":883},{"style":98},[884],{"type":25,"value":885}," size; i",{"type":20,"tag":79,"props":887,"children":888},{"style":152},[889],{"type":25,"value":890},"++",{"type":20,"tag":79,"props":892,"children":893},{"style":98},[894],{"type":25,"value":895},")\n",{"type":20,"tag":79,"props":897,"children":899},{"class":81,"line":898},35,[900,905],{"type":20,"tag":79,"props":901,"children":902},{"style":86},[903],{"type":25,"value":904},"       unchecked",{"type":20,"tag":79,"props":906,"children":907},{"style":98},[908],{"type":25,"value":182},{"type":20,"tag":79,"props":910,"children":912},{"class":81,"line":911},36,[913,918,922,927,932,937,942,947,952],{"type":20,"tag":79,"props":914,"children":915},{"style":98},[916],{"type":25,"value":917},"          hash ",{"type":20,"tag":79,"props":919,"children":920},{"style":152},[921],{"type":25,"value":301},{"type":20,"tag":79,"props":923,"children":924},{"style":98},[925],{"type":25,"value":926}," (hash ",{"type":20,"tag":79,"props":928,"children":929},{"style":152},[930],{"type":25,"value":931},"\u003C\u003C",{"type":20,"tag":79,"props":933,"children":934},{"style":304},[935],{"type":25,"value":936}," 4",{"type":20,"tag":79,"props":938,"children":939},{"style":98},[940],{"type":25,"value":941},") ",{"type":20,"tag":79,"props":943,"children":944},{"style":152},[945],{"type":25,"value":946},"+",{"type":20,"tag":79,"props":948,"children":949},{"style":516},[950],{"type":25,"value":951}," buffer",{"type":20,"tag":79,"props":953,"children":954},{"style":98},[955],{"type":25,"value":956},"[i];\n",{"type":20,"tag":79,"props":958,"children":960},{"class":81,"line":959},37,[961,966,971,975,979,984,989],{"type":20,"tag":79,"props":962,"children":963},{"style":174},[964],{"type":25,"value":965},"          UInt32",{"type":20,"tag":79,"props":967,"children":968},{"style":98},[969],{"type":25,"value":970}," work ",{"type":20,"tag":79,"props":972,"children":973},{"style":152},[974],{"type":25,"value":301},{"type":20,"tag":79,"props":976,"children":977},{"style":98},[978],{"type":25,"value":926},{"type":20,"tag":79,"props":980,"children":981},{"style":152},[982],{"type":25,"value":983},"&",{"type":20,"tag":79,"props":985,"children":986},{"style":304},[987],{"type":25,"value":988}," 0xf0000000",{"type":20,"tag":79,"props":990,"children":991},{"style":98},[992],{"type":25,"value":719},{"type":20,"tag":79,"props":994,"children":996},{"class":81,"line":995},38,[997,1002,1007,1012,1016],{"type":20,"tag":79,"props":998,"children":999},{"style":86},[1000],{"type":25,"value":1001},"          if",{"type":20,"tag":79,"props":1003,"children":1004},{"style":98},[1005],{"type":25,"value":1006}," (work ",{"type":20,"tag":79,"props":1008,"children":1009},{"style":152},[1010],{"type":25,"value":1011},"!=",{"type":20,"tag":79,"props":1013,"children":1014},{"style":304},[1015],{"type":25,"value":307},{"type":20,"tag":79,"props":1017,"children":1018},{"style":98},[1019],{"type":25,"value":895},{"type":20,"tag":79,"props":1021,"children":1023},{"class":81,"line":1022},39,[1024,1029,1034,1038,1043,1048],{"type":20,"tag":79,"props":1025,"children":1026},{"style":98},[1027],{"type":25,"value":1028},"             hash ",{"type":20,"tag":79,"props":1030,"children":1031},{"style":152},[1032],{"type":25,"value":1033},"^=",{"type":20,"tag":79,"props":1035,"children":1036},{"style":98},[1037],{"type":25,"value":1006},{"type":20,"tag":79,"props":1039,"children":1040},{"style":152},[1041],{"type":25,"value":1042},">>",{"type":20,"tag":79,"props":1044,"children":1045},{"style":304},[1046],{"type":25,"value":1047}," 24",{"type":20,"tag":79,"props":1049,"children":1050},{"style":98},[1051],{"type":25,"value":719},{"type":20,"tag":79,"props":1053,"children":1055},{"class":81,"line":1054},40,[1056,1060,1065,1070],{"type":20,"tag":79,"props":1057,"children":1058},{"style":98},[1059],{"type":25,"value":917},{"type":20,"tag":79,"props":1061,"children":1062},{"style":152},[1063],{"type":25,"value":1064},"&=",{"type":20,"tag":79,"props":1066,"children":1067},{"style":152},[1068],{"type":25,"value":1069}," ~",{"type":20,"tag":79,"props":1071,"children":1072},{"style":98},[1073],{"type":25,"value":1074},"work;\n",{"type":20,"tag":79,"props":1076,"children":1078},{"class":81,"line":1077},41,[1079],{"type":20,"tag":79,"props":1080,"children":1081},{"style":98},[1082],{"type":25,"value":1083},"       }\n",{"type":20,"tag":79,"props":1085,"children":1087},{"class":81,"line":1086},42,[1088,1092],{"type":20,"tag":79,"props":1089,"children":1090},{"style":86},[1091],{"type":25,"value":538},{"type":20,"tag":79,"props":1093,"children":1094},{"style":98},[1095],{"type":25,"value":201},{"type":20,"tag":79,"props":1097,"children":1099},{"class":81,"line":1098},43,[1100],{"type":20,"tag":79,"props":1101,"children":1102},{"style":98},[1103],{"type":25,"value":251},{"type":20,"tag":79,"props":1105,"children":1107},{"class":81,"line":1106},44,[1108],{"type":20,"tag":79,"props":1109,"children":1110},{"emptyLinePlaceholder":142},[1111],{"type":25,"value":145},{"type":20,"tag":79,"props":1113,"children":1115},{"class":81,"line":1114},45,[1116,1120,1124,1128,1133,1137,1141,1146],{"type":20,"tag":79,"props":1117,"children":1118},{"style":152},[1119],{"type":25,"value":191},{"type":20,"tag":79,"props":1121,"children":1122},{"style":275},[1123],{"type":25,"value":458},{"type":20,"tag":79,"props":1125,"children":1126},{"style":98},[1127],{"type":25,"value":364},{"type":20,"tag":79,"props":1129,"children":1130},{"style":221},[1131],{"type":25,"value":1132},"UInt32ToBigEndianBytes",{"type":20,"tag":79,"props":1134,"children":1135},{"style":98},[1136],{"type":25,"value":354},{"type":20,"tag":79,"props":1138,"children":1139},{"style":174},[1140],{"type":25,"value":644},{"type":20,"tag":79,"props":1142,"children":1143},{"style":367},[1144],{"type":25,"value":1145}," x",{"type":20,"tag":79,"props":1147,"children":1148},{"style":98},[1149],{"type":25,"value":403},{"type":20,"tag":79,"props":1151,"children":1153},{"class":81,"line":1152},46,[1154,1158,1163,1167],{"type":20,"tag":79,"props":1155,"children":1156},{"style":86},[1157],{"type":25,"value":538},{"type":20,"tag":79,"props":1159,"children":1160},{"style":86},[1161],{"type":25,"value":1162}," new",{"type":20,"tag":79,"props":1164,"children":1165},{"style":275},[1166],{"type":25,"value":458},{"type":20,"tag":79,"props":1168,"children":1169},{"style":98},[1170],{"type":25,"value":1171},"[] {\n",{"type":20,"tag":79,"props":1173,"children":1175},{"class":81,"line":1174},47,[1176,1181,1185,1190,1194,1198,1202,1206,1211],{"type":20,"tag":79,"props":1177,"children":1178},{"style":98},[1179],{"type":25,"value":1180},"       (",{"type":20,"tag":79,"props":1182,"children":1183},{"style":275},[1184],{"type":25,"value":359},{"type":20,"tag":79,"props":1186,"children":1187},{"style":98},[1188],{"type":25,"value":1189},")((x ",{"type":20,"tag":79,"props":1191,"children":1192},{"style":152},[1193],{"type":25,"value":1042},{"type":20,"tag":79,"props":1195,"children":1196},{"style":304},[1197],{"type":25,"value":1047},{"type":20,"tag":79,"props":1199,"children":1200},{"style":98},[1201],{"type":25,"value":941},{"type":20,"tag":79,"props":1203,"children":1204},{"style":152},[1205],{"type":25,"value":983},{"type":20,"tag":79,"props":1207,"children":1208},{"style":304},[1209],{"type":25,"value":1210}," 0xff",{"type":20,"tag":79,"props":1212,"children":1213},{"style":98},[1214],{"type":25,"value":1215},"),\n",{"type":20,"tag":79,"props":1217,"children":1219},{"class":81,"line":1218},48,[1220,1224,1228,1232,1236,1241,1245,1249,1253],{"type":20,"tag":79,"props":1221,"children":1222},{"style":98},[1223],{"type":25,"value":1180},{"type":20,"tag":79,"props":1225,"children":1226},{"style":275},[1227],{"type":25,"value":359},{"type":20,"tag":79,"props":1229,"children":1230},{"style":98},[1231],{"type":25,"value":1189},{"type":20,"tag":79,"props":1233,"children":1234},{"style":152},[1235],{"type":25,"value":1042},{"type":20,"tag":79,"props":1237,"children":1238},{"style":304},[1239],{"type":25,"value":1240}," 16",{"type":20,"tag":79,"props":1242,"children":1243},{"style":98},[1244],{"type":25,"value":941},{"type":20,"tag":79,"props":1246,"children":1247},{"style":152},[1248],{"type":25,"value":983},{"type":20,"tag":79,"props":1250,"children":1251},{"style":304},[1252],{"type":25,"value":1210},{"type":20,"tag":79,"props":1254,"children":1255},{"style":98},[1256],{"type":25,"value":1215},{"type":20,"tag":79,"props":1258,"children":1260},{"class":81,"line":1259},49,[1261,1265,1269,1273,1277,1282,1286,1290,1294],{"type":20,"tag":79,"props":1262,"children":1263},{"style":98},[1264],{"type":25,"value":1180},{"type":20,"tag":79,"props":1266,"children":1267},{"style":275},[1268],{"type":25,"value":359},{"type":20,"tag":79,"props":1270,"children":1271},{"style":98},[1272],{"type":25,"value":1189},{"type":20,"tag":79,"props":1274,"children":1275},{"style":152},[1276],{"type":25,"value":1042},{"type":20,"tag":79,"props":1278,"children":1279},{"style":304},[1280],{"type":25,"value":1281}," 8",{"type":20,"tag":79,"props":1283,"children":1284},{"style":98},[1285],{"type":25,"value":941},{"type":20,"tag":79,"props":1287,"children":1288},{"style":152},[1289],{"type":25,"value":983},{"type":20,"tag":79,"props":1291,"children":1292},{"style":304},[1293],{"type":25,"value":1210},{"type":20,"tag":79,"props":1295,"children":1296},{"style":98},[1297],{"type":25,"value":1215},{"type":20,"tag":79,"props":1299,"children":1301},{"class":81,"line":1300},50,[1302,1306,1310,1315,1319,1323],{"type":20,"tag":79,"props":1303,"children":1304},{"style":98},[1305],{"type":25,"value":1180},{"type":20,"tag":79,"props":1307,"children":1308},{"style":275},[1309],{"type":25,"value":359},{"type":20,"tag":79,"props":1311,"children":1312},{"style":98},[1313],{"type":25,"value":1314},")(x ",{"type":20,"tag":79,"props":1316,"children":1317},{"style":152},[1318],{"type":25,"value":983},{"type":20,"tag":79,"props":1320,"children":1321},{"style":304},[1322],{"type":25,"value":1210},{"type":20,"tag":79,"props":1324,"children":1325},{"style":98},[1326],{"type":25,"value":895},{"type":20,"tag":79,"props":1328,"children":1330},{"class":81,"line":1329},51,[1331],{"type":20,"tag":79,"props":1332,"children":1333},{"style":98},[1334],{"type":25,"value":1335},"    };\n",{"type":20,"tag":79,"props":1337,"children":1339},{"class":81,"line":1338},52,[1340],{"type":20,"tag":79,"props":1341,"children":1342},{"style":98},[1343],{"type":25,"value":251},{"type":20,"tag":79,"props":1345,"children":1347},{"class":81,"line":1346},53,[1348],{"type":20,"tag":79,"props":1349,"children":1350},{"style":98},[1351],{"type":25,"value":1352},"}\n",{"type":20,"tag":21,"props":1354,"children":1355},{},[1356],{"type":20,"tag":1357,"props":1358,"children":1359},"em",{},[1360],{"type":25,"value":1361},"[)amien",{"type":20,"tag":1363,"props":1364,"children":1365},"style",{},[1366],{"type":25,"value":1367},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":9,"searchDepth":104,"depth":104,"links":1369},[],"markdown","content:blog:2007:calculating-elf-32-in-c-and-net.md","content","blog/2007/calculating-elf-32-in-c-and-net.md","blog/2007/calculating-elf-32-in-c-and-net","md","/blog/2007/calculating-elf-32-in-c-and-net/",324,[1379,1383,1387],{"title":1380,"date":1381,"url":1382},"HTML5 Video Cheatsheet: Optimizing videos for the web","2025-12-05T00:00:00Z","/blog/2025/html5-video-cheatsheet/",{"title":1384,"date":1385,"url":1386},"Transactions in the MongoDB EF Core Provider","2025-10-25","/blog/2025/mongodb-explicit-transactions/",{"title":1388,"date":1389,"url":1390},"Queryable Encryption with the MongoDB EF Core Provider","2025-09-22","/blog/2025/mongodb-queryable-encryption/",[1392,1414,1759,1776],{"_path":1393,"_dir":1394,"_draft":6,"_partial":6,"_locale":7,"title":1395,"description":1396,"id":1397,"name":1398,"email":1399,"avatar":1400,"url":1401,"date":1402,"body":1403,"_type":1370,"_id":1411,"_source":1372,"_file":1412,"_stem":1413,"_extension":1375},"/comments/calculating-elf-32-in-c-and-net/9753","calculating-elf-32-in-c-and-net","9753","All hash functions can return the same hash code for a different input sets. If they didn't they would instead be very effective compression algorithms.",9753,"Damien Guard","damien@envytech.co.uk","https://www.gravatar.com/avatar/dc72963e7279d34c85ed4c0b731ce5a9?r=pg&d=retro","https://damieng.com/","2008-10-20T09:09:13",{"type":17,"children":1404,"toc":1409},[1405],{"type":20,"tag":21,"props":1406,"children":1407},{},[1408],{"type":25,"value":1396},{"title":9,"searchDepth":104,"depth":104,"links":1410},[],"content:comments:calculating-elf-32-in-c-and-net:9753.md","comments/calculating-elf-32-in-c-and-net/9753.md","comments/calculating-elf-32-in-c-and-net/9753",{"_path":1415,"_dir":1394,"_draft":6,"_partial":6,"_locale":7,"title":1416,"description":1417,"id":1418,"name":1419,"email":1420,"avatar":1421,"url":1422,"date":1423,"body":1424,"_type":1370,"_id":1756,"_source":1372,"_file":1757,"_stem":1758,"_extension":1375},"/comments/calculating-elf-32-in-c-and-net/9748","9748","hi Damien,",9748,"QuangCanh","thqcanh@yahoo.com","https://www.gravatar.com/avatar/1660f26b663fcc670c02b859f718d809?r=pg&d=retro","https://www.vinagame.com.vn","2008-10-20T01:33:15",{"type":17,"children":1425,"toc":1754},[1426,1430,1435,1740,1745,1750],{"type":20,"tag":21,"props":1427,"children":1428},{},[1429],{"type":25,"value":1417},{"type":20,"tag":21,"props":1431,"children":1432},{},[1433],{"type":25,"value":1434},"Can this algorithm duplicate?",{"type":20,"tag":68,"props":1436,"children":1438},{"className":70,"code":1437,"language":72,"meta":9,"style":9},"private static uint GetELF(string str)\n{\n       int i;\n       uint x;\n       uint result = 10;\n       byte[] b = ASCIIEncoding.Unicode.GetBytes(str);\n       for (i = 0; i \u003C b.Length; i++)\n       {\n              unchecked\n              {\n                     result = (result \u003C> 24);\n                     result &amp;= ~x;\n                     }\n              }\n       return result;\n}\n",[1439],{"type":20,"tag":75,"props":1440,"children":1441},{"__ignoreMap":9},[1442,1482,1490,1503,1516,1541,1582,1621,1629,1637,1645,1675,1704,1712,1720,1733],{"type":20,"tag":79,"props":1443,"children":1444},{"class":81,"line":82},[1445,1450,1454,1459,1464,1468,1473,1478],{"type":20,"tag":79,"props":1446,"children":1447},{"style":152},[1448],{"type":25,"value":1449},"private",{"type":20,"tag":79,"props":1451,"children":1452},{"style":152},[1453],{"type":25,"value":626},{"type":20,"tag":79,"props":1455,"children":1456},{"style":275},[1457],{"type":25,"value":1458}," uint",{"type":20,"tag":79,"props":1460,"children":1461},{"style":221},[1462],{"type":25,"value":1463}," GetELF",{"type":20,"tag":79,"props":1465,"children":1466},{"style":98},[1467],{"type":25,"value":354},{"type":20,"tag":79,"props":1469,"children":1470},{"style":275},[1471],{"type":25,"value":1472},"string",{"type":20,"tag":79,"props":1474,"children":1475},{"style":367},[1476],{"type":25,"value":1477}," str",{"type":20,"tag":79,"props":1479,"children":1480},{"style":98},[1481],{"type":25,"value":895},{"type":20,"tag":79,"props":1483,"children":1484},{"class":81,"line":104},[1485],{"type":20,"tag":79,"props":1486,"children":1487},{"style":98},[1488],{"type":25,"value":1489},"{\n",{"type":20,"tag":79,"props":1491,"children":1492},{"class":81,"line":138},[1493,1498],{"type":20,"tag":79,"props":1494,"children":1495},{"style":275},[1496],{"type":25,"value":1497},"       int",{"type":20,"tag":79,"props":1499,"children":1500},{"style":98},[1501],{"type":25,"value":1502}," i;\n",{"type":20,"tag":79,"props":1504,"children":1505},{"class":81,"line":148},[1506,1511],{"type":20,"tag":79,"props":1507,"children":1508},{"style":275},[1509],{"type":25,"value":1510},"       uint",{"type":20,"tag":79,"props":1512,"children":1513},{"style":98},[1514],{"type":25,"value":1515}," x;\n",{"type":20,"tag":79,"props":1517,"children":1518},{"class":81,"line":185},[1519,1523,1528,1532,1537],{"type":20,"tag":79,"props":1520,"children":1521},{"style":275},[1522],{"type":25,"value":1510},{"type":20,"tag":79,"props":1524,"children":1525},{"style":98},[1526],{"type":25,"value":1527}," result ",{"type":20,"tag":79,"props":1529,"children":1530},{"style":152},[1531],{"type":25,"value":301},{"type":20,"tag":79,"props":1533,"children":1534},{"style":304},[1535],{"type":25,"value":1536}," 10",{"type":20,"tag":79,"props":1538,"children":1539},{"style":98},[1540],{"type":25,"value":101},{"type":20,"tag":79,"props":1542,"children":1543},{"class":81,"line":204},[1544,1549,1554,1558,1563,1568,1572,1577],{"type":20,"tag":79,"props":1545,"children":1546},{"style":275},[1547],{"type":25,"value":1548},"       byte",{"type":20,"tag":79,"props":1550,"children":1551},{"style":98},[1552],{"type":25,"value":1553},"[] b ",{"type":20,"tag":79,"props":1555,"children":1556},{"style":152},[1557],{"type":25,"value":301},{"type":20,"tag":79,"props":1559,"children":1560},{"style":98},[1561],{"type":25,"value":1562}," ASCIIEncoding.",{"type":20,"tag":79,"props":1564,"children":1565},{"style":516},[1566],{"type":25,"value":1567},"Unicode",{"type":20,"tag":79,"props":1569,"children":1570},{"style":98},[1571],{"type":25,"value":37},{"type":20,"tag":79,"props":1573,"children":1574},{"style":221},[1575],{"type":25,"value":1576},"GetBytes",{"type":20,"tag":79,"props":1578,"children":1579},{"style":98},[1580],{"type":25,"value":1581},"(str);\n",{"type":20,"tag":79,"props":1583,"children":1584},{"class":81,"line":212},[1585,1590,1595,1599,1604,1608,1613,1617],{"type":20,"tag":79,"props":1586,"children":1587},{"style":86},[1588],{"type":25,"value":1589},"       for",{"type":20,"tag":79,"props":1591,"children":1592},{"style":98},[1593],{"type":25,"value":1594}," (i = 0; i ",{"type":20,"tag":79,"props":1596,"children":1597},{"style":152},[1598],{"type":25,"value":880},{"type":20,"tag":79,"props":1600,"children":1601},{"style":98},[1602],{"type":25,"value":1603}," b.",{"type":20,"tag":79,"props":1605,"children":1606},{"style":516},[1607],{"type":25,"value":714},{"type":20,"tag":79,"props":1609,"children":1610},{"style":98},[1611],{"type":25,"value":1612},"; i",{"type":20,"tag":79,"props":1614,"children":1615},{"style":152},[1616],{"type":25,"value":890},{"type":20,"tag":79,"props":1618,"children":1619},{"style":98},[1620],{"type":25,"value":895},{"type":20,"tag":79,"props":1622,"children":1623},{"class":81,"line":231},[1624],{"type":20,"tag":79,"props":1625,"children":1626},{"style":98},[1627],{"type":25,"value":1628},"       {\n",{"type":20,"tag":79,"props":1630,"children":1631},{"class":81,"line":245},[1632],{"type":20,"tag":79,"props":1633,"children":1634},{"style":86},[1635],{"type":25,"value":1636},"              unchecked\n",{"type":20,"tag":79,"props":1638,"children":1639},{"class":81,"line":254},[1640],{"type":20,"tag":79,"props":1641,"children":1642},{"style":98},[1643],{"type":25,"value":1644},"              {\n",{"type":20,"tag":79,"props":1646,"children":1647},{"class":81,"line":262},[1648,1653,1657,1662,1667,1671],{"type":20,"tag":79,"props":1649,"children":1650},{"style":98},[1651],{"type":25,"value":1652},"                     result ",{"type":20,"tag":79,"props":1654,"children":1655},{"style":152},[1656],{"type":25,"value":301},{"type":20,"tag":79,"props":1658,"children":1659},{"style":98},[1660],{"type":25,"value":1661}," (result ",{"type":20,"tag":79,"props":1663,"children":1664},{"style":152},[1665],{"type":25,"value":1666},"\u003C>",{"type":20,"tag":79,"props":1668,"children":1669},{"style":304},[1670],{"type":25,"value":1047},{"type":20,"tag":79,"props":1672,"children":1673},{"style":98},[1674],{"type":25,"value":719},{"type":20,"tag":79,"props":1676,"children":1677},{"class":81,"line":290},[1678,1682,1686,1691,1695,1699],{"type":20,"tag":79,"props":1679,"children":1680},{"style":98},[1681],{"type":25,"value":1652},{"type":20,"tag":79,"props":1683,"children":1684},{"style":152},[1685],{"type":25,"value":983},{"type":20,"tag":79,"props":1687,"children":1688},{"style":98},[1689],{"type":25,"value":1690},"amp;",{"type":20,"tag":79,"props":1692,"children":1693},{"style":152},[1694],{"type":25,"value":301},{"type":20,"tag":79,"props":1696,"children":1697},{"style":152},[1698],{"type":25,"value":1069},{"type":20,"tag":79,"props":1700,"children":1701},{"style":98},[1702],{"type":25,"value":1703},"x;\n",{"type":20,"tag":79,"props":1705,"children":1706},{"class":81,"line":314},[1707],{"type":20,"tag":79,"props":1708,"children":1709},{"style":98},[1710],{"type":25,"value":1711},"                     }\n",{"type":20,"tag":79,"props":1713,"children":1714},{"class":81,"line":322},[1715],{"type":20,"tag":79,"props":1716,"children":1717},{"style":98},[1718],{"type":25,"value":1719},"              }\n",{"type":20,"tag":79,"props":1721,"children":1722},{"class":81,"line":330},[1723,1728],{"type":20,"tag":79,"props":1724,"children":1725},{"style":86},[1726],{"type":25,"value":1727},"       return",{"type":20,"tag":79,"props":1729,"children":1730},{"style":98},[1731],{"type":25,"value":1732}," result;\n",{"type":20,"tag":79,"props":1734,"children":1735},{"class":81,"line":406},[1736],{"type":20,"tag":79,"props":1737,"children":1738},{"style":98},[1739],{"type":25,"value":1352},{"type":20,"tag":21,"props":1741,"children":1742},{},[1743],{"type":25,"value":1744},"hash code of \"mj9d\" and \"oj9f\" is the same.",{"type":20,"tag":21,"props":1746,"children":1747},{},[1748],{"type":25,"value":1749},"regards,\nCanh",{"type":20,"tag":1363,"props":1751,"children":1752},{},[1753],{"type":25,"value":1367},{"title":9,"searchDepth":104,"depth":104,"links":1755},[],"content:comments:calculating-elf-32-in-c-and-net:9748.md","comments/calculating-elf-32-in-c-and-net/9748.md","comments/calculating-elf-32-in-c-and-net/9748",{"_path":1760,"_dir":1394,"_draft":6,"_partial":6,"_locale":7,"title":1761,"description":1762,"id":1763,"name":1398,"email":1399,"avatar":1400,"url":1401,"date":1764,"body":1765,"_type":1370,"_id":1773,"_source":1372,"_file":1774,"_stem":1775,"_extension":1375},"/comments/calculating-elf-32-in-c-and-net/5837","5837","Yeah you are probably right.  I will revise it.",5837,"2008-01-09T00:30:27",{"type":17,"children":1766,"toc":1771},[1767],{"type":20,"tag":21,"props":1768,"children":1769},{},[1770],{"type":25,"value":1762},{"title":9,"searchDepth":104,"depth":104,"links":1772},[],"content:comments:calculating-elf-32-in-c-and-net:5837.md","comments/calculating-elf-32-in-c-and-net/5837.md","comments/calculating-elf-32-in-c-and-net/5837",{"_path":1777,"_dir":1394,"_draft":6,"_partial":6,"_locale":7,"title":1778,"description":9,"id":1779,"name":1780,"email":1781,"avatar":1782,"url":1783,"date":1784,"body":1785,"_type":1370,"_id":1850,"_source":1372,"_file":1851,"_stem":1852,"_extension":1375},"/comments/calculating-elf-32-in-c-and-net/5400","5400",5400,"bitRAKE","bitRAKE@gmail.com","https://www.gravatar.com/avatar/5821bf1e14b2f2a1597426c84b115d30?r=pg&d=retro","https://bitrake.blogspot.com/","2007-12-04T08:04:06",{"type":17,"children":1786,"toc":1848},[1787,1839,1844],{"type":20,"tag":68,"props":1788,"children":1790},{"className":70,"code":1789,"language":72,"meta":9,"style":9},"if (work != 0) hash ^= (work >> 24);\n",[1791],{"type":20,"tag":75,"props":1792,"children":1793},{"__ignoreMap":9},[1794],{"type":20,"tag":79,"props":1795,"children":1796},{"class":81,"line":82},[1797,1802,1806,1810,1814,1819,1823,1827,1831,1835],{"type":20,"tag":79,"props":1798,"children":1799},{"style":86},[1800],{"type":25,"value":1801},"if",{"type":20,"tag":79,"props":1803,"children":1804},{"style":98},[1805],{"type":25,"value":1006},{"type":20,"tag":79,"props":1807,"children":1808},{"style":152},[1809],{"type":25,"value":1011},{"type":20,"tag":79,"props":1811,"children":1812},{"style":304},[1813],{"type":25,"value":307},{"type":20,"tag":79,"props":1815,"children":1816},{"style":98},[1817],{"type":25,"value":1818},") hash ",{"type":20,"tag":79,"props":1820,"children":1821},{"style":152},[1822],{"type":25,"value":1033},{"type":20,"tag":79,"props":1824,"children":1825},{"style":98},[1826],{"type":25,"value":1006},{"type":20,"tag":79,"props":1828,"children":1829},{"style":152},[1830],{"type":25,"value":1042},{"type":20,"tag":79,"props":1832,"children":1833},{"style":304},[1834],{"type":25,"value":1047},{"type":20,"tag":79,"props":1836,"children":1837},{"style":98},[1838],{"type":25,"value":719},{"type":20,"tag":21,"props":1840,"children":1841},{},[1842],{"type":25,"value":1843},"Makes me wonder if it costs more to avoid this than to just do it anyway when work==0? As it has no effect on hash when work==0, and I'm almost certain it'll always be slower to branch.",{"type":20,"tag":1363,"props":1845,"children":1846},{},[1847],{"type":25,"value":1367},{"title":9,"searchDepth":104,"depth":104,"links":1849},[],"content:comments:calculating-elf-32-in-c-and-net:5400.md","comments/calculating-elf-32-in-c-and-net/5400.md","comments/calculating-elf-32-in-c-and-net/5400",1779264589596]