Skip to content

Commit 3d7978c

Browse files
committed
Partially implement ObjectIT 2
1 parent b74067d commit 3d7978c

File tree

2 files changed

+545
-0
lines changed

2 files changed

+545
-0
lines changed

s3mock_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import re
66
import time
77
import uuid
8+
from enum import Enum
89
from pathlib import Path
910
from typing import Optional
1011
from 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+
]

0 commit comments

Comments
 (0)