Changeset f3563b5 in osmose-backend


Ignore:
Timestamp:
May 25, 2014 11:17:51 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
136f4ef
Parents:
53372d1
git-author:
Jocelyn Jaubert <jocelyn.jaubert@…> (25/05/2014 23:16:46)
git-committer:
Jocelyn Jaubert <jocelyn.jaubert@…> (25/05/2014 23:17:51)
Message:

Fix stablehash() to handle unicode strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • analysers/Analyser.py

    re2ccccb rf3563b5  
    6565        @param s: a string 
    6666        """ 
    67         return int(abs(int(hashlib.md5(s).hexdigest(), 16)) % 2147483647) 
     67        return int(abs(int(hashlib.md5(s.encode("utf-8")).hexdigest(), 16)) % 2147483647) 
Note: See TracChangeset for help on using the changeset viewer.