Ejemplo n.º 1
0
        private void hash_Click(object sender, EventArgs e)
        {
            if (this.unhasher32 != null && !this.unhasher32.Finished)
            {
                return;
            }
            if (this.unhasher64 != null && !this.unhasher64.Finished)
            {
                return;
            }
            string strToHash = this.inputTxt.Text;
            uint   xor32Hash = FNVHash.HashString24(strToHash) & filter32;
            uint   fnv32Hash = FNVHash.HashString32(strToHash) & filter32;
            ulong  xor64Hash = FNVHash.HashString48(strToHash) & filter64;
            ulong  fnv64Hash = FNVHash.HashString64(strToHash) & filter64;

            this.resultsLST.Items.AddRange(new object[]
            {
                string.Concat("FNV Hash of ", strToHash),
                string.Concat("0x", fnv32Hash.ToString("X8"), "         | FNV 32"),
                string.Concat("0x", fnv64Hash.ToString("X16"), " | FNV 64"),
                string.Concat("0x", xor32Hash.ToString("X8"), "         | Xor Folded FNV 32"),
                string.Concat("0x", xor64Hash.ToString("X16"), " | Xor Folded FNV 64")
            });
        }