/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
Crypto
/
Hash
/
/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Hash
mkdir
upload
Name
Size
Mode
Actions
hashalgo.py
3984
0644
edit
dl
rm
hashalgo.pyc
3977
0644
edit
dl
rm
hashalgo.pyo
3977
0644
edit
dl
rm
HMAC.py
7302
0644
edit
dl
rm
HMAC.pyc
6201
0644
edit
dl
rm
HMAC.pyo
6201
0644
edit
dl
rm
MD2.py
2734
0644
edit
dl
rm
MD2.pyc
2182
0644
edit
dl
rm
MD2.pyo
2182
0644
edit
dl
rm
MD4.py
2716
0644
edit
dl
rm
MD4.pyc
2169
0644
edit
dl
rm
MD4.pyo
2169
0644
edit
dl
rm
MD5.py
2863
0644
edit
dl
rm
MD5.pyc
2216
0644
edit
dl
rm
MD5.pyo
2216
0644
edit
dl
rm
RIPEMD.py
3005
0644
edit
dl
rm
RIPEMD.pyc
2409
0644
edit
dl
rm
RIPEMD.pyo
2409
0644
edit
dl
rm
SHA.py
2841
0644
edit
dl
rm
SHA.pyc
2201
0644
edit
dl
rm
SHA.pyo
2201
0644
edit
dl
rm
SHA224.py
2851
0644
edit
dl
rm
SHA224.pyc
2257
0644
edit
dl
rm
SHA224.pyo
2257
0644
edit
dl
rm
SHA256.py
2852
0644
edit
dl
rm
SHA256.pyc
2257
0644
edit
dl
rm
SHA256.pyo
2257
0644
edit
dl
rm
SHA384.py
2853
0644
edit
dl
rm
SHA384.pyc
2257
0644
edit
dl
rm
SHA384.pyo
2257
0644
edit
dl
rm
SHA512.py
2850
0644
edit
dl
rm
SHA512.pyc
2257
0644
edit
dl
rm
SHA512.pyo
2257
0644
edit
dl
rm
_MD2.so
29811
0755
edit
dl
rm
_MD4.so
33767
0755
edit
dl
rm
_RIPEMD160.so
38725
0755
edit
dl
rm
_SHA224.so
33177
0755
edit
dl
rm
_SHA256.so
33177
0755
edit
dl
rm
_SHA384.so
33153
0755
edit
dl
rm
_SHA512.so
33153
0755
edit
dl
rm
__init__.py
2432
0644
edit
dl
rm
__init__.pyc
1668
0644
edit
dl
rm
__init__.pyo
1668
0644
edit
dl
rm
Edit:
/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Hash/hashalgo.py
(3984B)
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to exercise all rights associated with the # contents of this file for any purpose whatsoever. # No rights are reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # =================================================================== from binascii import hexlify class HashAlgo: """A generic class for an abstract cryptographic hash algorithm. :undocumented: block_size """ #: The size of the resulting hash in bytes. digest_size = None #: The internal block size of the hash algorithm in bytes. block_size = None def __init__(self, hashFactory, data=None): """Initialize the hash object. :Parameters: hashFactory : callable An object that will generate the actual hash implementation. *hashFactory* must have a *new()* method, or must be directly callable. data : byte string The very first chunk of the message to hash. It is equivalent to an early call to `update()`. """ if hasattr(hashFactory, 'new'): self._hash = hashFactory.new() else: self._hash = hashFactory() if data: self.update(data) def update(self, data): """Continue hashing of a message by consuming the next chunk of data. Repeated calls are equivalent to a single call with the concatenation of all the arguments. In other words: >>> m.update(a); m.update(b) is equivalent to: >>> m.update(a+b) :Parameters: data : byte string The next chunk of the message being hashed. """ return self._hash.update(data) def digest(self): """Return the **binary** (non-printable) digest of the message that has been hashed so far. This method does not change the state of the hash object. You can continue updating the object after calling this function. :Return: A byte string of `digest_size` bytes. It may contain non-ASCII characters, including null bytes. """ return self._hash.digest() def hexdigest(self): """Return the **printable** digest of the message that has been hashed so far. This method does not change the state of the hash object. :Return: A string of 2* `digest_size` characters. It contains only hexadecimal ASCII digits. """ return self._hash.hexdigest() def copy(self): """Return a copy ("clone") of the hash object. The copy will have the same internal state as the original hash object. This can be used to efficiently compute the digests of strings that share a common initial substring. :Return: A hash object of the same type """ return self._hash.copy() def new(self, data=None): """Return a fresh instance of the hash object. Unlike the `copy` method, the internal state of the object is empty. :Parameters: data : byte string The next chunk of the message being hashed. :Return: A hash object of the same type """ pass
Save
cmd:
run