Skip to content

Commit

Permalink
Add sha256 unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Jun 10, 2024
1 parent b2478d0 commit f08c339
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ omit =
*import_database.py
*mnemonic_key_create.py
*sign_raw.py
*benchmark.py
*wallet_multisig_2of3.py
*dashd.py
*bitcoind.py
*dogecoind.py
*bcoin.py
Expand All @@ -15,9 +15,9 @@ omit =
*cryptoid.py
*chainso.py
*litecoreio.py
*insightdash.py
*litecoinblockexplorer.py
*bitflyer.py
*blocksmurfer.py
[report]
exclude_lines =
pragma: no cover
Expand All @@ -29,3 +29,4 @@ exclude_lines =
if 0:
if __name__ == .__main__.:
if not PY3
except ImportError
9 changes: 9 additions & 0 deletions tests/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,15 @@ def test_encryption_aes(self):
quote = aes_decrypt(encrypted_data, key)
self.assertEqual(data, quote)

class TestEncodingCrypto(unittest.TestCase):

def test_sha256(self):

self.assertEqual(sha256(b'a' * 1000000).hex(),
'cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0')
self.assertEqual(sha256(b'a' * 1000000, as_hex=True),
'cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0')


if __name__ == '__main__':
unittest.main()

0 comments on commit f08c339

Please sign in to comment.