Stop using deprecated md5, switch to hashlib. Closes #36
This commit is contained in:
parent
70bb7d47e0
commit
b8957e0c6e
@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
import md5
|
||||
import hashlib
|
||||
|
||||
from moto.core import BaseBackend
|
||||
from moto.core.utils import iso_8601_datetime, rfc_1123_datetime
|
||||
@ -22,7 +22,7 @@ class FakeKey(object):
|
||||
|
||||
@property
|
||||
def etag(self):
|
||||
value_md5 = md5.new()
|
||||
value_md5 = hashlib.md5()
|
||||
value_md5.update(self.value)
|
||||
return '"{0}"'.format(value_md5.hexdigest())
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import md5
|
||||
import hashlib
|
||||
import time
|
||||
|
||||
from moto.core import BaseBackend
|
||||
@ -15,7 +15,7 @@ class Message(object):
|
||||
|
||||
@property
|
||||
def md5(self):
|
||||
body_md5 = md5.new()
|
||||
body_md5 = hashlib.md5()
|
||||
body_md5.update(self.body)
|
||||
return body_md5.hexdigest()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user