From: Michael Tremer Date: Fri, 26 Nov 2010 17:15:16 +0000 (+0100) Subject: Fix private_id function. X-Git-Tag: v0.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e2ba24ef8888fa8a44e6a28a8d3b5cfb2d0f0b8;p=oddments%2Ffireinfo.git Fix private_id function. The builtin function reversed() returned a generator which created a new hash everytime. --- diff --git a/fireinfo/system.py b/fireinfo/system.py index 43807c3..a8b7618 100644 --- a/fireinfo/system.py +++ b/fireinfo/system.py @@ -96,7 +96,11 @@ class System(object): No one could ever guess this without access to the host. """ - return hashlib.sha1("%s" % reversed(self._unique_id)).hexdigest() + private_id = "" + for i in reversed(self._unique_id): + private_id += i + + return hashlib.sha1(private_id).hexdigest() @property def _unique_id(self):