def test_sha1_iterated(self): h = Hash.sha1_new() h.update('a') h.update('b') h.update('c') digest = h.digest() expected = b'\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d' self.assertEqual(expected, digest)
def test_sha1_empty(self): h = Hash.sha1_new() digest = h.digest() expected = b'\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09' self.assertEqual(expected, digest)