From 50836075261339c9d0ff4f49b743088461c6399e Mon Sep 17 00:00:00 2001 From: bbm Date: Wed, 22 Feb 2023 09:41:25 -0500 Subject: [PATCH] add optional content hash to File object --- orsopy/fileio/base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/orsopy/fileio/base.py b/orsopy/fileio/base.py index 8e3db140..6c352d44 100644 --- a/orsopy/fileio/base.py +++ b/orsopy/fileio/base.py @@ -724,6 +724,16 @@ def to_sigma(self): return 1.0 +@orsodataclass +class ContentHash(Header): + """ + A hash of some content, using standard algorithms + """ + + digest: str + algorithm: Literal["sha1", "sha256", "sha384", "sha512", "sha3_256", "sha3_512"] + + @orsodataclass class File(Header): """ @@ -739,6 +749,7 @@ class File(Header): " itself" }, ) + hash: Optional[ContentHash] = None def __post_init__(self): """