Пример #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()))
Пример #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)
Пример #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)
Пример #4
0
	def test_invert_hash_success(self):
		mytext="proofnet:text"
		inverted=proofnet.invert_hash(hashlib.sha256(mytext.encode()).digest())
		self.assertEqual(mytext,inverted)
Пример #5
0
 def test_invert_hash_success(self):
     mytext = "proofnet:text"
     inverted = proofnet.invert_hash(
         hashlib.sha256(mytext.encode()).digest())
     self.assertEqual(mytext, inverted)