public void X13_Hash() { var hasher = new X13(); var result = hasher.Digest(testValue2).ToHexString(); Assert.Equal("55b2b7f940ffb87bdb138ebdb04b8f823aa55736852c06ea9de46124f85d70e9", result); }
private byte[] CalculateHash(byte[] data, int offset, int count) { byte[] hashData = data.SafeSubarray(offset, count); uint256 hash = null; if (this.nVersion > 6) { hash = Hashes.Hash256(hashData); } else { var x13 = new X13(); hash = new uint256(this.x13.ComputeBytes(hashData)); } return(hash.ToBytes()); }
class X22 { public X22(X12 p1, X13 p2, X14 p3, X15 p4, X16 p5, X17 p6, X18 p7, X19 p8, X20 p9, X21 p10) { }
class X21 { public X21(X11 p1, X12 p2, X13 p3, X14 p4, X15 p5, X16 p6, X17 p7, X18 p8, X19 p9, X20 p10) { }
class X20 { public X20(X10 p1, X11 p2, X12 p3, X13 p4, X14 p5, X15 p6, X16 p7, X17 p8, X18 p9, X19 p10) { }
class X19 { public X19(X09 p1, X10 p2, X11 p3, X12 p4, X13 p5, X14 p6, X15 p7, X16 p8, X17 p9, X18 p10) { }
class X18 { public X18(X08 p1, X09 p2, X10 p3, X11 p4, X12 p5, X13 p6, X14 p7, X15 p8, X16 p9, X17 p10) { }
class X17 { public X17(X07 p1, X08 p2, X09 p3, X10 p4, X11 p5, X12 p6, X13 p7, X14 p8, X15 p9, X16 p10) { }
class X16 { public X16(X06 p1, X07 p2, X08 p3, X09 p4, X10 p5, X11 p6, X12 p7, X13 p8, X14 p9, X15 p10) { }
class X15 { public X15(X05 p1, X06 p2, X07 p3, X08 p4, X09 p5, X10 p6, X11 p7, X12 p8, X13 p9, X14 p10) { }
class X14 { public X14(X04 p1, X05 p2, X06 p3, X07 p4, X08 p5, X09 p6, X10 p7, X11 p8, X12 p9, X13 p10) { }
class X23 { public X23(X13 p1, X14 p2, X15 p3, X16 p4, X17 p5, X18 p6, X19 p7, X20 p8, X21 p9, X22 p10) { }
public StratisBlockHeader() : base() { this.x13 = new X13(); }
private void button1_Click(object sender, EventArgs e) { button2.Visible = true; button3.Visible = true; button4.Visible = true; dataGridView2.Rows.Clear(); for (int c = 0; c < 4; c++) { for (int r = 0; r < 5; r++) { dataGridView1[c, r].Value = String.Empty; dataGridView1[c, r].Style.BackColor = Color.White; } } for (int r = 0; r < 12; r++) { dataGridView2.Rows.Add(); dataGridView2.Rows[r].HeaderCell.Value = (r + 1).ToString(); } X1 = dateTimePicker1.Value.Day; X2 = (X1 % 10); X1 = (X1 / 10); X3 = dateTimePicker1.Value.Month; X4 = (X3 % 10); X3 = (X3 / 10); X5 = dateTimePicker1.Value.Year; X6 = (X5 % 1000) / 100; X7 = (X5 % 100) / 10; X8 = (X5 % 10); X5 = (X5 / 1000); X9 = X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8; X10 = (X9 % 10) + (X9 / 10); X11 = X9 - (X1 * 2); X12 = (X11 % 10) + (X11 / 10); X13 = X9 + X11; X14 = X10 + X12; textBox1.Text = X9.ToString(); textBox2.Text = X10.ToString(); textBox3.Text = X11.ToString(); textBox4.Text = X12.ToString(); textBox5.Text = X13.ToString(); textBox6.Text = X14.ToString(); bigN = dateTimePicker1.Value.ToShortDateString() + textBox1.Text + textBox2.Text + textBox3.Text + textBox4.Text; smlN = textBox5.Text + textBox6.Text; Calc(0); for (int i = 0; i < 3; i++) { bn = 0; sn = 0; for (int j = 1; j < 4; j++) { Calc(i * 3 + j); } if (bn > 12) { bn = (bn % 10) + (bn / 10); } if (sn > 12) { sn = (sn % 10) + (sn / 10); } dataGridView1[3, i + 1].Value = bn.ToString() + '(' + sn.ToString() + ')'; } for (int i = 10; i < 13; i++) { if ((i == X13) || (i == X14)) { switch (i) { case 10: dataGridView1[0, 4].Value = "(10)"; dataGridView1[0, 4].Style.BackColor = Color.Blue; break; case 11: dataGridView1[1, 4].Value = "(11)"; dataGridView1[1, 4].Style.BackColor = Color.Blue; break; case 12: dataGridView1[2, 4].Value = "(12)"; dataGridView1[2, 4].Style.BackColor = Color.Blue; break; } dataGridView1[3, 4].Value = '(' + i.ToString() + ')'; } } BigTable(); GrafMake(); }
public void X13_Hash_Should_Throw_On_Null_Input() { var hasher = new X13(); Assert.Throws <ArgumentNullException>(() => hasher.Digest(null)); }