summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-12 19:07:55 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-12 19:07:55 +0200
commit5b489a994d009771d7f4d5beec45bbbb5468cd58 (patch)
tree799087779e02af7648232dcf36889263329408d7 /doc
parent64513033774fb0264c601f021da5d5f6345c3dd4 (diff)
downloadpython-apt-5b489a994d009771d7f4d5beec45bbbb5468cd58.tar.gz
python/hashes.cc: Introduce the Hashes class.
The Hashes class is a function which calculates all supported hashes for one input. DebImg will use this for calculating the hashes of files.
Diffstat (limited to 'doc')
-rw-r--r--doc/source/apt_pkg.rst26
1 files changed, 21 insertions, 5 deletions
diff --git a/doc/source/apt_pkg.rst b/doc/source/apt_pkg.rst
index 2af934a0..9a14266e 100644
--- a/doc/source/apt_pkg.rst
+++ b/doc/source/apt_pkg.rst
@@ -1139,15 +1139,31 @@ installation.
the file using the parameter *destfile*. You can not combine both.
+Hashes
+------
+The apt_pkg module also provides several hash functions. If you develop
+applications with python-apt it is often easier to use these functions instead
+of the ones provides in Python's :mod:`hashlib` module.
+.. class:: Hashes(object)
+ Calculate all supported hashes of the object. *object* may either be a
+ string, in which cases the hashes of the string are calculated, or a
+ :class:`file()` object or file descriptor, in which case the hashes of
+ its contents is calculated. The calculated hashes are then available via
+ attributes:
+ .. attribute:: md5
-Hash functions
---------------
-The apt_pkg module also provides several hash functions. If you develop
-applications with python-apt it is often easier to use these functions instead
-of the ones provides in Python's :mod:`hashlib` module.
+ The MD5 hash of the data, as string.
+
+ .. attribute:: sha1
+
+ The SHA1 hash of the data, as string.
+
+ .. attribute:: sha256
+
+ The SHA256 hash of the data, as string.
.. function:: md5sum(object)