Skip to content

Commit

Permalink
Merge pull request #85 from nileshpatra/encode-hash-example
Browse files Browse the repository at this point in the history
Encode hash result in hash_starts_numeric
  • Loading branch information
jgallowa07 committed Aug 25, 2020
2 parents 11ae5ab + 98f3bf9 commit 84e1895
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 84e1895

Please sign in to comment.