aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-02-02 12:59:16 +0100
committercedricbonhomme <devnull@localhost>2010-02-02 12:59:16 +0100
commitbcbaa557e9068bbb1781e6d8f80e5751815398dc (patch)
treedcc738261c89e0e6e9de8013bb0eeb924eb99024 /pyAggr3g470r.py
parentMinor enhancements. (diff)
downloadnewspipe-bcbaa557e9068bbb1781e6d8f80e5751815398dc.tar.gz
newspipe-bcbaa557e9068bbb1781e6d8f80e5751815398dc.tar.bz2
newspipe-bcbaa557e9068bbb1781e6d8f80e5751815398dc.zip
Bug fix : replaced base64 by sha256 to generate identiants of URL.
Diffstat (limited to 'pyAggr3g470r.py')
-rw-r--r--pyAggr3g470r.py9
1 files changed, 6 insertions, 3 deletions
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])
bgstack15