Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Klinische Genetica
prinia
Commits
498d3487
Commit
498d3487
authored
Aug 14, 2017
by
Sander Bollen
Browse files
hashes must be encoded in python3
parent
02cddf6c
Changes
1
Show whitespace changes
Inline
Side-by-side
prinia/utils.py
View file @
498d3487
...
...
@@ -5,6 +5,7 @@ __author__ = 'ahbbollen'
from
datetime
import
datetime
import
hashlib
import
sys
import
vcf
...
...
@@ -54,7 +55,12 @@ class NoPrimersException(Exception):
def
datehash
():
a
=
datetime
.
utcnow
()
st
=
"{:f}"
.
format
((
a
-
datetime
(
1970
,
1
,
1
)).
total_seconds
())
if
sys
.
version_info
[
0
]
==
2
:
hash
=
hashlib
.
md5
(
st
).
hexdigest
()
elif
sys
.
version_info
[
0
]
==
3
:
hash
=
hashlib
.
md5
(
st
.
encode
(
"utf-8"
)).
hexdigest
()
else
:
raise
NotImplementedError
return
hash
[:
5
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment