[Python-checkins] CVS: python/dist/src/Doc/lib libmd5.tex,1.17,1.18 libsha.tex,1.5,1.6

Tim Peters python-dev@python.org
Mon, 18 Sep 2000 08:35:00 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv7453/python/dist/src/doc/lib

Modified Files:
	libmd5.tex libsha.tex 
Log Message:
Repaired some glitches in the MD5 and SHA docs; copied the descriptions of
the MD5 methods into the SHA docs (substituting "sha" for "md5", of course,
and changing the stuff that depended on digest size accordingly).
Fred, don't trust me!


Index: libmd5.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmd5.tex,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** libmd5.tex	2000/09/14 21:47:32	1.17
--- libmd5.tex	2000/09/18 15:34:57	1.18
***************
*** 9,13 ****
  \index{message digest, MD5}
  algorithm (see also Internet \rfc{1321}).  Its use is quite
! straightforward:\ use the \function{new()} to create an md5 object.
  You can now feed this object with arbitrary strings using the
  \method{update()} method, and at any point you can ask it for the
--- 9,13 ----
  \index{message digest, MD5}
  algorithm (see also Internet \rfc{1321}).  Its use is quite
! straightforward:\ use \function{new()} to create an md5 object.
  You can now feed this object with arbitrary strings using the
  \method{update()} method, and at any point you can ask it for the
***************
*** 57,61 ****
  \begin{methoddesc}[md5]{digest}{}
  Return the digest of the strings passed to the \method{update()}
! method so far.  This is an 16-byte string which may contain
  non-\ASCII{} characters, including null bytes.
  \end{methoddesc}
--- 57,61 ----
  \begin{methoddesc}[md5]{digest}{}
  Return the digest of the strings passed to the \method{update()}
! method so far.  This is a 16-byte string which may contain
  non-\ASCII{} characters, including null bytes.
  \end{methoddesc}
***************
*** 63,67 ****
  \begin{methoddesc}[md5]{hexdigest}{}
  Like \method{digest()} except the digest is returned as a string of
! length 32, containing only hexadecimal digits.
  \end{methoddesc}
  
--- 63,69 ----
  \begin{methoddesc}[md5]{hexdigest}{}
  Like \method{digest()} except the digest is returned as a string of
! length 32, containing only hexadecimal digits.  This may 
! be used to exchange the value safely in email or other non-binary
! environments.
  \end{methoddesc}
  

Index: libsha.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsha.tex,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** libsha.tex	2000/09/16 04:59:33	1.5
--- libsha.tex	2000/09/18 15:34:57	1.6
***************
*** 9,18 ****
  This module implements the interface to NIST's\index{NIST} secure hash 
  algorithm,\index{Secure Hash Algorithm} known as SHA.  It is used in
! the same way as the \refmodule{md5} module:\ use the \function{new()}
  to create an sha object, then feed this object with arbitrary strings
  using the \method{update()} method, and at any point you can ask it
  for the \dfn{digest} of the concatenation of the strings fed to it
! so far.\index{checksum!SHA}  SHA digests are 160 bits instead of 128
! bits.
  
  
--- 9,18 ----
  This module implements the interface to NIST's\index{NIST} secure hash 
  algorithm,\index{Secure Hash Algorithm} known as SHA.  It is used in
! the same way as the \refmodule{md5} module:\ use \function{new()}
  to create an sha object, then feed this object with arbitrary strings
  using the \method{update()} method, and at any point you can ask it
  for the \dfn{digest} of the concatenation of the strings fed to it
! so far.\index{checksum!SHA}  SHA digests are 160 bits instead of
! MD5's 128 bits.
  
  
***************
*** 38,49 ****
  
  
! A sha object has all the methods the md5 objects have, plus one:
  
  \begin{methoddesc}[sha]{hexdigest}{}
!   Return the digest value as a string of hexadecimal digits.  This may 
!   be used to exchange the value safely in email or other non-binary
!   environments.
  \end{methoddesc}
  
  
  \begin{seealso}
--- 38,68 ----
  
  
! An sha object has the same methods as md5 objects:
  
+ \begin{methoddesc}[sha]{update}{arg}
+ Update the sha object with the string \var{arg}.  Repeated calls are
+ equivalent to a single call with the concatenation of all the
+ arguments, i.e.\ \code{m.update(a); m.update(b)} is equivalent to
+ \code{m.update(a+b)}.
+ \end{methoddesc}
+ 
+ \begin{methoddesc}[sha]{digest}{}
+ Return the digest of the strings passed to the \method{update()}
+ method so far.  This is a 20-byte string which may contain
+ non-\ASCII{} characters, including null bytes.
+ \end{methoddesc}
+ 
  \begin{methoddesc}[sha]{hexdigest}{}
! Like \method{digest()} except the digest is returned as a string of
! length 40, containing only hexadecimal digits.  This may 
! be used to exchange the value safely in email or other non-binary
! environments.
  \end{methoddesc}
  
+ \begin{methoddesc}[sha]{copy}{}
+ Return a copy (``clone'') of the sha object.  This can be used to
+ efficiently compute the digests of strings that share a common initial
+ substring.
+ \end{methoddesc}
  
  \begin{seealso}