Skip to content

module file_hashes_table

Methods for computing and displaying various file hashes.

Global Variables

  • GREY_COLOR
  • DEFAULT_TABLE_OPTIONS

function bytes_hashes_table

bytes_hashes_table(
    bytes_or_info: bytes | BytesInfo,
    title: str | None = None,
    title_justify: Literal['default', 'left', 'center', 'right', 'full'] = 'left'
) → Table

Build a Rich Table displaying the size, MD5, SHA1, and SHA256 hashes of a byte sequence.

Args:

  • bytes_or_info (Union[bytes, BytesInfo]): The bytes to hash, or a BytesInfo namedtuple with precomputed values.
  • title (str | None, optional): Optional title for the table. Defaults to None.
  • title_justify (JustifyMethod, optional): Justification for the table title. Defaults to "LEFT".

Returns:

  • Table: A Rich Table object with the size and hash values.

class BytesInfo

Compute the size, MD5, SHA1, and SHA256 hashes for some bytes.

method __init__

__init__(_bytes: bytes) → None

property md5


property sha1


property sha256


property size


classmethod for_file

for_file(file_path: str | Path) → BytesInfo

Alternate constructor that reads the bytes from file_path.


method hash_dict

hash_dict() → dict[str, str]

This file was automatically generated via lazydocs.