[Python-checkins] CVS: python/nondist/peps pep-0247.txt,1.7,1.8

A.M. Kuchling akuchling@users.sourceforge.net
2001年10月21日 19:10:31 -0700


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv2895
Modified Files:
	pep-0247.txt 
Log Message:
Add rationale section
Index: pep-0247.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0247.txt,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pep-0247.txt	2001年10月09日 21:13:07	1.7
--- pep-0247.txt	2001年10月22日 02:10:29	1.8
***************
*** 116,119 ****
--- 116,137 ----
 
 
+ Rationale
+ 
+ The digest size is measured in bytes, not bits, even though hash
+ algorithm sizes are usually quoted in bits; MD5 is a 128-bit
+ algorithm and not a 16-byte one, for example. This is because, in
+ the sample code I looked at, the length in bytes is often needed
+ (to seek ahead or behind in a file; to compute the length of an
+ output string) while the length in bits is rarely used.
+ Therefore, the burden will fall on the few people actually needing
+ the size in bits, who will have to multiply digest_size by 8.
+ 
+ It's been suggested that the update() method would be better named
+ append(). However, that method is really causing the current
+ state of the hashing object to be updated, and update() is already
+ used by the md5 and sha modules included with Python, so it seems
+ simplest to leave the name update() alone.
+ 
+ 
 Changes
 

AltStyle によって変換されたページ (->オリジナル) /