whitespace cleanup

This commit is contained in:
Christian Heimes 2013-08-17 14:29:35 +02:00
parent 3212f41821
commit a666aa670b
1 changed files with 11 additions and 11 deletions

View File

@ -34,7 +34,7 @@ Specification
'string' parameter, if supplied, will be immediately hashed
into the object's starting state, as if obj.update(string) was
called.
After creating a hashing object, arbitrary strings can be fed
into the object using its update() method, and the hash value
can be obtained at any time by calling the object's digest()
@ -70,7 +70,7 @@ Specification
object is created, and this attribute must contain the
selected size. Therefore None is *not* a legal value for this
attribute.
Hashing objects require the following methods:
@ -89,19 +89,19 @@ Specification
hexdigest()
Return the hash value of this hashing object as a string
containing hexadecimal digits. Lowercase letters should be used
containing hexadecimal digits. Lowercase letters should be used
for the digits 'a' through 'f'. Like the .digest() method, this
method mustn't alter the object.
update(string)
Hash 'string' into the current state of the hashing object.
update() can be called any number of times during a hashing
object's lifetime.
Hashing modules can define additional module-level functions or
Hashing modules can define additional module-level functions or
object methods and still be compliant with this specification.
Here's an example, using a module named 'MD5':
>>> from Crypto.Hash import MD5
@ -110,11 +110,11 @@ Specification
16
>>> m.update('abc')
>>> m.digest()
'\x90\x01P\x98<\xd2O\xb0\xd6\x96?}(\xe1\x7fr'
'\x90\x01P\x98<\xd2O\xb0\xd6\x96?}(\xe1\x7fr'
>>> m.hexdigest()
'900150983cd24fb0d6963f7d28e17f72'
'900150983cd24fb0d6963f7d28e17f72'
>>> MD5.new('abc').digest()
'\x90\x01P\x98<\xd2O\xb0\xd6\x96?}(\xe1\x7fr'
'\x90\x01P\x98<\xd2O\xb0\xd6\x96?}(\xe1\x7fr'
Rationale
@ -140,8 +140,8 @@ Rationale
to place required parameters first, but that also means that the
'string' parameter moves from the first position to the second.
It would be possible to get confused and pass a single argument to
a keyed hash, thinking that you're passing an initial string to an
unkeyed hash, but it doesn't seem worth making the interface
a keyed hash, thinking that you're passing an initial string to an
unkeyed hash, but it doesn't seem worth making the interface
for keyed hashes more obscure to avoid this potential error.