summaryrefslogtreecommitdiffstats
path: root/Lib/sha.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2005-08-21 18:45:59 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2005-08-21 18:45:59 (GMT)
commitf21a5f773964d34c7b6deb7e3d753fae2b9c70e2 (patch)
treeba3b66cea11da1d8e930555aa5a10f775a285d84 /Lib/sha.py
parent33a5f2af59ddcf3f1b0447a8dbd0576fd78de303 (diff)
downloadcpython-f21a5f773964d34c7b6deb7e3d753fae2b9c70e2.zip
cpython-f21a5f773964d34c7b6deb7e3d753fae2b9c70e2.tar.gz
cpython-f21a5f773964d34c7b6deb7e3d753fae2b9c70e2.tar.bz2
[ sf.net patch # 1121611 ]
A new hashlib module to replace the md5 and sha modules. It adds support for additional secure hashes such as SHA-256 and SHA-512. The hashlib module uses OpenSSL for fast platform optimized implementations of algorithms when available. The old md5 and sha modules still exist as wrappers around hashlib to preserve backwards compatibility.
Diffstat (limited to 'Lib/sha.py')
-rw-r--r--Lib/sha.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/sha.py b/Lib/sha.py
new file mode 100644
index 0000000..9d914a9
--- /dev/null
+++ b/Lib/sha.py
@@ -0,0 +1,11 @@
+# $Id$
+#
+# Copyright (C) 2005 Gregory P. Smith (greg@electricrain.com)
+# Licensed to PSF under a Contributor Agreement.
+
+from hashlib import sha1 as sha
+new = sha
+
+blocksize = 1 # legacy value (wrong in any useful sense)
+digest_size = 20
+digestsize = 20