Clarify description of update() (Boyd Roberts)
Clarify description of new (Tim Peters)
This commit is contained in:
parent
a307f83a41
commit
407ce7575f
26
pep-0247.txt
26
pep-0247.txt
|
@ -26,15 +26,17 @@ Specification
|
||||||
new([string])
|
new([string])
|
||||||
new([key] , [string])
|
new([key] , [string])
|
||||||
|
|
||||||
Create a new hashing object and return it. You can now feed
|
Create a new hashing object and return it. The first form is
|
||||||
arbitrary strings into the object using its update() method,
|
for hashes that are unkeyed; most hashes such as MD5 or SHA
|
||||||
and can ask for the hash value at any time by calling its
|
are unkeyed. For keyed hashes such as HMAC, 'key' is a string
|
||||||
digest() method.
|
containing the starting key. The 'string' parameter, if
|
||||||
|
supplied, will be immediately hashed into the object's
|
||||||
The 'string' parameter, if supplied, will be immediately
|
starting state, as if obj.update(string) was called.
|
||||||
hashed into the object's starting state; an empty string or
|
|
||||||
None. For keyed hashes such as HMAC, 'key' is a string
|
After creating a hashing object, arbitrary strings can be fed
|
||||||
containing the starting key.
|
into the object using its update() method, and the hash value
|
||||||
|
can be obtained at any time by calling the object's digest()
|
||||||
|
method.
|
||||||
|
|
||||||
Arbitrary additional keyword arguments can be added to this
|
Arbitrary additional keyword arguments can be added to this
|
||||||
function, but if they're not supplied, sensible default values
|
function, but if they're not supplied, sensible default values
|
||||||
|
@ -88,9 +90,11 @@ Specification
|
||||||
for the digits 'a' through 'f'. Like the .digest() method, this
|
for the digits 'a' through 'f'. Like the .digest() method, this
|
||||||
method mustn't alter the object.
|
method mustn't alter the object.
|
||||||
|
|
||||||
update(arg)
|
update(string)
|
||||||
|
|
||||||
Update this hashing object with the string 'arg'.
|
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.
|
object methods and still be compliant with this specification.
|
||||||
|
|
Loading…
Reference in New Issue