From 98f3bf9ef645a2ddd77cf6e8c4b75ea4dfa1bb46 Mon Sep 17 00:00:00 2001 From: Nilesh Patra Date: Sun, 16 Aug 2020 13:47:58 +0000 Subject: [PATCH] Encode hash result in hash_starts_numeric --- examples/apply-function/myfunctions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/apply-function/myfunctions.py b/examples/apply-function/myfunctions.py index eead61a..e0f2a50 100644 --- a/examples/apply-function/myfunctions.py +++ b/examples/apply-function/myfunctions.py @@ -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