From bcbaa557e9068bbb1781e6d8f80e5751815398dc Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Tue, 2 Feb 2010 12:59:16 +0100 Subject: Bug fix : replaced base64 by sha256 to generate identiants of URL. --- pyAggr3g470r.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 9bee7d7b..f91ac258 100644 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -7,8 +7,8 @@ __date__ = "$Date: 2010/02/01 $" __copyright__ = "Copyright (c) 2010 Cedric Bonhomme" __license__ = "GPLv3" -import base64 import sqlite3 +import hashlib import cherrypy import ConfigParser @@ -141,8 +141,11 @@ class Root: dic = {} if list_of_articles is not None: for article in list_of_articles: - feed_id = base64.b64encode(article[5].encode('utf-8')) - article_id = base64.b64encode(article[2].encode('utf-8')) + sha256_hash = hashlib.sha256() + sha256_hash.update(article[5].encode('utf-8')) + feed_id = sha256_hash.hexdigest() + sha256_hash.update(article[2].encode('utf-8')) + article_id = sha256_hash.hexdigest() article_tuple = (article_id, article[0], article[1], article[2], article[3], article[4], article[5]) -- cgit