Permalink
Browse files

Really switch to hashlib

Closes #5
  • Loading branch information...
1 parent 91f848e commit 3013f427cb48628e80dc83c5d96dcc9cc618fc77 @nkuttler nkuttler committed Feb 15, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −1 doc/changelog.rst
  2. +2 −2 piwikapi/tests/base.py
  3. +2 −2 piwikapi/tracking.py
View
@@ -4,7 +4,7 @@ Changelog
0.3 (2013-02-)
----------------
-- Switch to setuptools
+- Switch to setuptools and hashlib
0.2.2 (2013-01-20)
------------------
View
@@ -1,9 +1,9 @@
-import md5
import os
import pprint
import sys
import time
import unittest
+from hashlib import md5
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
@@ -50,7 +50,7 @@ def get_random_string(self):
:type length: inte
:rtype: str
"""
- return md5.new(os.urandom(500)).hexdigest()
+ return md5(os.urandom(500)).hexdigest()
def get_unique_string(self, length=20):
epoch = str(time.time())
View
@@ -10,12 +10,12 @@
import datetime
import json
import logging
-import md5
import os
import random
import urllib
import urllib2
import urlparse
+from hashlib import md5
from exceptions import ConfigurationError
from exceptions import InvalidParameter
@@ -523,7 +523,7 @@ def __get_random_string(self, length=500):
:type length: inte
:rtype: str
"""
- return md5.new(os.urandom(length)).hexdigest()
+ return md5(os.urandom(length)).hexdigest()
def get_random_visitor_id(self):
"""

0 comments on commit 3013f42

Please sign in to comment.