spdx_tools.spdx.model.checksum
1# SPDX-FileCopyrightText: 2022 spdx contributors 2# 3# SPDX-License-Identifier: Apache-2.0 4from enum import Enum, auto 5 6from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties 7from spdx_tools.common.typing.type_checks import check_types_and_set_values 8 9 10class ChecksumAlgorithm(Enum): 11 SHA1 = auto() 12 SHA224 = auto() 13 SHA256 = auto() 14 SHA384 = auto() 15 SHA512 = auto() 16 SHA3_256 = auto() 17 SHA3_384 = auto() 18 SHA3_512 = auto() 19 BLAKE2B_256 = auto() 20 BLAKE2B_384 = auto() 21 BLAKE2B_512 = auto() 22 BLAKE3 = auto() 23 MD2 = auto() 24 MD4 = auto() 25 MD5 = auto() 26 MD6 = auto() 27 ADLER32 = auto() 28 29 30@dataclass_with_properties 31class Checksum: 32 algorithm: ChecksumAlgorithm 33 value: str 34 35 def __init__(self, algorithm: ChecksumAlgorithm, value: str): 36 check_types_and_set_values(self, locals())
class
ChecksumAlgorithm(enum.Enum):
11class ChecksumAlgorithm(Enum): 12 SHA1 = auto() 13 SHA224 = auto() 14 SHA256 = auto() 15 SHA384 = auto() 16 SHA512 = auto() 17 SHA3_256 = auto() 18 SHA3_384 = auto() 19 SHA3_512 = auto() 20 BLAKE2B_256 = auto() 21 BLAKE2B_384 = auto() 22 BLAKE2B_512 = auto() 23 BLAKE3 = auto() 24 MD2 = auto() 25 MD4 = auto() 26 MD5 = auto() 27 MD6 = auto() 28 ADLER32 = auto()
SHA1 =
<ChecksumAlgorithm.SHA1: 1>
SHA224 =
<ChecksumAlgorithm.SHA224: 2>
SHA256 =
<ChecksumAlgorithm.SHA256: 3>
SHA384 =
<ChecksumAlgorithm.SHA384: 4>
SHA512 =
<ChecksumAlgorithm.SHA512: 5>
SHA3_256 =
<ChecksumAlgorithm.SHA3_256: 6>
SHA3_384 =
<ChecksumAlgorithm.SHA3_384: 7>
SHA3_512 =
<ChecksumAlgorithm.SHA3_512: 8>
BLAKE2B_256 =
<ChecksumAlgorithm.BLAKE2B_256: 9>
BLAKE2B_384 =
<ChecksumAlgorithm.BLAKE2B_384: 10>
BLAKE2B_512 =
<ChecksumAlgorithm.BLAKE2B_512: 11>
BLAKE3 =
<ChecksumAlgorithm.BLAKE3: 12>
MD2 =
<ChecksumAlgorithm.MD2: 13>
MD4 =
<ChecksumAlgorithm.MD4: 14>
MD5 =
<ChecksumAlgorithm.MD5: 15>
MD6 =
<ChecksumAlgorithm.MD6: 16>
ADLER32 =
<ChecksumAlgorithm.ADLER32: 17>
Inherited Members
- enum.Enum
- name
- value
@dataclass_with_properties
class
Checksum:
31@dataclass_with_properties 32class Checksum: 33 algorithm: ChecksumAlgorithm 34 value: str 35 36 def __init__(self, algorithm: ChecksumAlgorithm, value: str): 37 check_types_and_set_values(self, locals())
Checksum( algorithm: ChecksumAlgorithm, value: str)
algorithm: ChecksumAlgorithm