Exemple #1
0
 def test_sha1(self):
     hash_ = _BuiltinHashWrapper("sha1")
     eq_(hash_("hello"), "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d")
Exemple #2
0
    def test_non_ascii_string(self):
        hash_ = _BuiltinHashWrapper("sha1")
        utf8_string = u"\xe4\xbd\xa0\xe5\xa5\xbd"

        eq_(hash_(utf8_string), "990e5af8616cd9269852a1bacf7230d261e89b60")
Exemple #3
0
 def test_md5(self):
     hash_ = _BuiltinHashWrapper("md5")
     eq_(hash_("hello"), "5d41402abc4b2a76b9719d911017c592")