From: Tomas Krizek Date: Wed, 2 Jan 2019 14:34:30 +0000 (+0100) Subject: dnssec/hash: remove obsolete module X-Git-Tag: v2.0.0rc1~387^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e60c2b1e0ad72f47729fb2acff5bf91ed7301f0e;p=thirdparty%2Fdnspython.git dnssec/hash: remove obsolete module --- diff --git a/differences.md b/differences.md index 0896e8fc..89e0e80c 100644 --- a/differences.md +++ b/differences.md @@ -4,3 +4,7 @@ dnspython 2.0 rounds in the standard python 3 fashion; dnspython 1.x rounded in the python 2 style on both python 2 and 3. + +# Removed hash module + +dns.hash module was removed. Use Python built in hashlib instead. diff --git a/dns/__init__.py b/dns/__init__.py index c1ce8e60..510b45e4 100644 --- a/dns/__init__.py +++ b/dns/__init__.py @@ -24,7 +24,6 @@ __all__ = [ 'entropy', 'exception', 'flags', - 'hash', 'inet', 'ipv4', 'ipv6', diff --git a/dns/hash.py b/dns/hash.py deleted file mode 100644 index 1713e628..00000000 --- a/dns/hash.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license - -# Copyright (C) 2011 Nominum, Inc. -# -# Permission to use, copy, modify, and distribute this software and its -# documentation for any purpose with or without fee is hereby granted, -# provided that the above copyright notice and this permission notice -# appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -"""Hashing backwards compatibility wrapper""" - -import hashlib -import warnings - -warnings.warn( - "dns.hash module will be removed in future versions. Please use hashlib instead.", - DeprecationWarning) - -hashes = {} -hashes['MD5'] = hashlib.md5 -hashes['SHA1'] = hashlib.sha1 -hashes['SHA224'] = hashlib.sha224 -hashes['SHA256'] = hashlib.sha256 -hashes['SHA384'] = hashlib.sha384 -hashes['SHA512'] = hashlib.sha512 - - -def get(algorithm): - return hashes[algorithm.upper()]