swh.objstorage.constants module#

swh.objstorage.constants.ID_HEXDIGEST_LENGTH = 40#

Size in bytes of the hash hexadecimal representation.

swh.objstorage.constants.ID_DIGEST_LENGTH = 20#

Size in bytes of the hash

swh.objstorage.constants.DEFAULT_LIMIT = 10000#

Default number of results of list_content.

swh.objstorage.constants.VALID_HEXCHARS = frozenset({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'})#

Valid characters for hexadecimal values

swh.objstorage.constants.ID_HEXDIGEST_LENGTH_BY_ALGO: Dict[Literal['sha1', 'sha256'], int] = {'sha1': 40, 'sha256': 64}#

Length of a valid hexdigest for each “primary” algorithm

swh.objstorage.constants.is_valid_hexdigest(hexdigest: str, algo: Literal['sha1', 'sha256'])[source]#

Return whether hexdigest is a valid hexdigest for the given algo.