From c2b2177ff358258a44edf895e05a7c9a982aab80 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Wed, 15 Mar 2023 19:57:23 +0000 Subject: Use blake2b instead of sha256 as the data hash With a digest size of 32 so it takes up the same amount of space --- paste/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paste/db.py b/paste/db.py index f1071e8..6671a12 100644 --- a/paste/db.py +++ b/paste/db.py @@ -1,7 +1,7 @@ import sqlite3 from collections.abc import Iterator from contextlib import contextmanager -from hashlib import blake2b, sha256 +from hashlib import blake2b from itertools import count from typing import Optional, Union @@ -41,7 +41,7 @@ def _sha256_udf(b: Union[bytes, str]) -> bytes: def _data_hash_udf(b: Union[bytes, str]) -> bytes: if isinstance(b, str): b = b.encode() - return sha256(b).digest() + return blake2b(b, digest_size=32).digest() def get_version(conn: sqlite3.Connection) -> int: -- cgit v1.2.3-54-g00ecf