File tree Expand file tree Collapse file tree 2 files changed +545
-0
lines changed
Expand file tree Collapse file tree 2 files changed +545
-0
lines changed Original file line number Diff line number Diff line change 55import re
66import time
77import uuid
8+ from enum import Enum
89from pathlib import Path
910from typing import Optional
1011from urllib .parse import unquote as _url_unquote
@@ -388,3 +389,23 @@ def chars_to_avoid_key() -> str:
388389 Returns a single string with chars to avoid (optionally prefixed).
389390 """
390391 return f"{ PREFIX } { chars_to_avoid ()} "
392+
393+ # Reimplementation of the Kotlin selection of checksum algorithms.
394+ class ChecksumAlgorithm (str , Enum ):
395+ SHA256 = "SHA256"
396+ SHA1 = "SHA1"
397+ CRC32 = "CRC32"
398+ CRC32C = "CRC32C"
399+ CRC64NVME = "CRC64NVME"
400+
401+ def checksum_algorithms () -> list [ChecksumAlgorithm ]:
402+ """
403+ Returns the set of checksum algorithms to test/use, mirroring the original selection.
404+ """
405+ return [
406+ ChecksumAlgorithm .SHA256 ,
407+ ChecksumAlgorithm .SHA1 ,
408+ ChecksumAlgorithm .CRC32 ,
409+ ChecksumAlgorithm .CRC32C ,
410+ ChecksumAlgorithm .CRC64NVME ,
411+ ]
You can’t perform that action at this time.
0 commit comments