Module block_size

Source
Expand description

Utility related to block size part of the fuzzy hash.

See also: “Block Size” section of FuzzyHashData

Constants§

MIN
The minimum block size of a fuzzy hash.
NUM_VALID
The number of valid block sizes.

Functions§

cmp
Compares two base-2 logarithm forms of the block size values for ordering.
compare_sizes
Compare two base-2 logarithm forms of the block size values to determine the relation between two block sizes.
from_log
Converts base-2 logarithm form of the block size to the actual one.
from_log_uncheckedunchecked
Converts base-2 logarithm form of the block size to the actual one without checking validity of the block size.
is_log_valid
Checks whether base-2 logarithm form of the block size is valid.
is_near
Checks whether two base-2 logarithm forms of the block size values form a near relation (one of the three near cases).
is_near_eq
Checks whether two base-2 logarithm forms of the block size values form a BlockSizeRelation::NearEq relation.
is_near_gt
Checks whether two base-2 logarithm forms of the block size values form a BlockSizeRelation::NearGt relation.
is_near_lt
Checks whether two base-2 logarithm forms of the block size values form a BlockSizeRelation::NearLt relation.
is_valid
Checks whether a given block size is valid.
log_from_valid
Computes the base-2 logarithm form of a valid block size.
log_from_valid_uncheckedunchecked
Computes the base-2 logarithm form of a valid block size but do not check whether the block size is valid.