import proofnet import hashlib print(proofnet.invert_hash(hashlib.sha256(b"proofnet").digest())) print(proofnet.invert_hash(hashlib.sha256(b"Unknown hash").digest()))
def test_invert_hash_fail(self): mytext="not a known hash" inverted=proofnet.invert_hash(hashlib.sha256(mytext.encode()).digest()) self.assertEqual(False,inverted)
def test_invert_hash_fail(self): mytext = "not a known hash" inverted = proofnet.invert_hash( hashlib.sha256(mytext.encode()).digest()) self.assertEqual(False, inverted)
def test_invert_hash_success(self): mytext="proofnet:text" inverted=proofnet.invert_hash(hashlib.sha256(mytext.encode()).digest()) self.assertEqual(mytext,inverted)
def test_invert_hash_success(self): mytext = "proofnet:text" inverted = proofnet.invert_hash( hashlib.sha256(mytext.encode()).digest()) self.assertEqual(mytext, inverted)