A friendly cryptography library.
Project description
xycrypto
Usage
>>> from xycrypto.hashes import SHA256
# Hash byte string using classmethod SHA256.hash.
>>> SHA256.hash(b'Hello, world!')
b'1_[\xdbv\xd0x\xc4;\x8a\xc0\x06NJ\x01da+\x1f\xcew\xc8i4[\xfc\x94\xc7X\x94\xed\xd3'
# If you want hex-string.
>>> SHA256.hash(b'Hello, world!').hex()
'315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3'
# Hash unicode string, encoded as UTF-8.
>>> SHA256.hash('Hello, world!').hex()
'315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3'
# Hash file using classmethod SHA256.hash_file.
>>> SHA256.hash_file('path/to/file').hex()
'e69bd8e7e0dfadcda3f9785668c3918c469ebbe30fa42fb1158b638afdb9f7f7'
# Hash directory using classmethod SHA256.hash_dir.
>>> SHA256.hash_dir('path/to/dir').hex()
'746a5c6a0aac95507c96a192071ccdd762b5c69372d0cc66973a1e1dfcc73927'
# Context Interface.
>>> ctx = SHA256()
>>> ctx.update(b'Hello, world!')
>>> ctx.finalize().hex()
'315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3'
Support MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224, SHA3_256, SHA3_384, SHA3_512, SHAKE128, SHAKE256, BLAKE2b, BLAKE2s.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xycrypto-0.1.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xycrypto-0.1.tar.gz.
File metadata
- Download URL: xycrypto-0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eba659c9bd0b03cc1b608c9d012d10264272f02a2a289e0059e81c46d58d4499
|
|
| MD5 |
900467a0f862b7297e27dfd823445cfb
|
|
| BLAKE2b-256 |
72ef7c22e38b4c0bcf9644a33d0922be26553b301eb58b3bd4c11cd164c4f9ce
|
File details
Details for the file xycrypto-0.1-py3-none-any.whl.
File metadata
- Download URL: xycrypto-0.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594ce93a2a8b0b21fc305c1f9c85bd878fffc8187666e3ab03722b26040b4b91
|
|
| MD5 |
90619cf0b9e4e377da8ca7e572edac78
|
|
| BLAKE2b-256 |
ee4a6563abacf9f02598bf5c091dbe63e149733a9638fd76f6a0a67dd9861104
|