dew.data.sources.codec
The ArrayRecord byte-map layout and the artifact record codec.
| Name | Summary |
|---|---|
Value | |
Unencodable | A value the artifact codec has no encoding for, as a record a cache keeps meets it. |
pack_dict_of_byte_arrays | |
unpack_dict_of_byte_arrays | |
encode | |
decode | |
content_fingerprint | SHA256 of content with every mapping ordered by key. |
fingerprint | |
encoded_fingerprint | fingerprint of the values encoded holds, each as encode wrote it, for a caller that holds their encodings already. |
Unencodable
Section titled “Unencodable”class Unencodable(TypeError)A value the artifact codec has no encoding for, as a record a cache keeps meets it.
pack_dict_of_byte_arrays
Section titled “pack_dict_of_byte_arrays”def pack_dict_of_byte_arrays(values: Mapping[str, bytes]) -> bytesunpack_dict_of_byte_arrays
Section titled “unpack_dict_of_byte_arrays”def unpack_dict_of_byte_arrays(payload: bytes) -> dict[str, bytes]encode
Section titled “encode”def encode(value: Value, *, canonical: bool = False) -> bytesdecode
Section titled “decode”def decode(value: bytes) -> Valuecontent_fingerprint
Section titled “content_fingerprint”def content_fingerprint(value: Value, *, opaque: bool = False) -> bytesSHA256 of content with every mapping ordered by key. opaque reads any object, a mapping’s
keys of any type and an array in any storage order, hashing each leaf as it is read (_Hashed),
for a digest that guards a stream rather than an artifact anyone decodes
(dew.data.dataset.Replayed).
fingerprint
Section titled “fingerprint”def fingerprint(values: Iterable[Value]) -> strencoded_fingerprint
Section titled “encoded_fingerprint”def encoded_fingerprint(encoded: Iterable[bytes]) -> strfingerprint of the values encoded holds, each as encode wrote it, for a caller that holds
their encodings already.