diff --git a/anki/utils.py b/anki/utils.py index a2c99bc2c..c31d2c872 100644 --- a/anki/utils.py +++ b/anki/utils.py @@ -4,7 +4,7 @@ import re, os, random, time, types, math, htmlentitydefs, subprocess, \ tempfile, shutil -from hashlib import md5, sha1 +from hashlib import sha1 from anki.lang import _, ngettext import locale, sys @@ -198,9 +198,6 @@ def splitFields(string): ############################################################################## def checksum(data): - return md5(data).hexdigest() - -def sha1sum(data): return sha1(data).hexdigest() def fieldChecksum(data): diff --git a/tests/test_deck.py b/tests/test_deck.py index 2325923a7..9ccbfd25b 100644 --- a/tests/test_deck.py +++ b/tests/test_deck.py @@ -89,7 +89,7 @@ def test_fieldChecksum(): f['Front'] = u"new"; f['Back'] = u"new2" deck.addFact(f) assert deck.db.scalar( - "select csum from fsums") == int("22af645d", 16) + "select csum from fsums") == int("c2a6b03f", 16) # empty field should have no checksum f['Front'] = u"" f.flush() @@ -99,7 +99,7 @@ def test_fieldChecksum(): f['Front'] = u"newx" f.flush() assert deck.db.scalar( - "select csum from fsums") == int("4b0e5a4c", 16) + "select csum from fsums") == int("302811ae", 16) # turning off unique and modifying the fact should delete the sum m = f.model() m['flds'][0]['uniq'] = False