Implement lab4 S3 attachments and reliability checks
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
|
||||
|
||||
def object_lock_id(bucket: str, object_key: str) -> int:
|
||||
value = f"s3-object\0{bucket}\0{object_key}".encode("utf-8")
|
||||
return int.from_bytes(
|
||||
hashlib.sha256(value).digest()[:8],
|
||||
byteorder="big",
|
||||
signed=True,
|
||||
)
|
||||
Reference in New Issue
Block a user