Skip to content

Commit

Permalink
Encode hash result in hash_starts_numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshpatra committed Aug 25, 2020
1 parent 11ae5ab commit 98f3bf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/apply-function/myfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def hash_starts_numeric(records):
their sha-1 hash.
"""
for record in records:
seq_hash = hashlib.sha1(str(record.seq)).hexdigest()
seq_hash = hashlib.sha1(str(record.seq).encode('utf-8')).hexdigest()
if seq_hash[0].isdigit():
yield record

0 comments on commit 98f3bf9

Please sign in to comment.