diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-11-05 01:45:06 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-11-05 01:45:06 +0100 |
commit | 2a8202e74846d191a321cca1202175af9db6107d (patch) | |
tree | a6f455caf07da1186851f343a237a4c4e4484f46 /python/tests/utils_test.py | |
parent | 8efa0ec17d8c262f9c3fd7603e8074f74a053708 (diff) |
Diffstat (limited to 'python/tests/utils_test.py')
-rw-r--r-- | python/tests/utils_test.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/python/tests/utils_test.py b/python/tests/utils_test.py deleted file mode 100644 index 86fb34f..0000000 --- a/python/tests/utils_test.py +++ /dev/null @@ -1,25 +0,0 @@ -import base64 -import hashlib - -from future.utils import bytes_to_native_str - -from olm import sha256 -from olm._compat import to_bytes - - -class TestClass(object): - def test_sha256(self): - input1 = "It's a secret to everybody" - input2 = "It's a secret to nobody" - - first_hash = sha256(input1) - second_hash = sha256(input2) - - hashlib_hash = base64.b64encode( - hashlib.sha256(to_bytes(input1)).digest() - ) - - hashlib_hash = bytes_to_native_str(hashlib_hash[:-1]) - - assert first_hash != second_hash - assert hashlib_hash == first_hash |