Exemplo n.º 1
0
import proofnet
import hashlib

print(proofnet.invert_hash(hashlib.sha256(b"proofnet").digest()))
print(proofnet.invert_hash(hashlib.sha256(b"Unknown hash").digest()))
Exemplo n.º 2
0
	def test_invert_hash_fail(self):
		mytext="not a known hash"
		inverted=proofnet.invert_hash(hashlib.sha256(mytext.encode()).digest())
		self.assertEqual(False,inverted)
Exemplo n.º 3
0
 def test_invert_hash_fail(self):
     mytext = "not a known hash"
     inverted = proofnet.invert_hash(
         hashlib.sha256(mytext.encode()).digest())
     self.assertEqual(False, inverted)
Exemplo n.º 4
0
	def test_invert_hash_success(self):
		mytext="proofnet:text"
		inverted=proofnet.invert_hash(hashlib.sha256(mytext.encode()).digest())
		self.assertEqual(mytext,inverted)
Exemplo n.º 5
0
 def test_invert_hash_success(self):
     mytext = "proofnet:text"
     inverted = proofnet.invert_hash(
         hashlib.sha256(mytext.encode()).digest())
     self.assertEqual(mytext, inverted)