Rexd.Delta.Stats (Rexd v1.0.0)

Copy Markdown View Source

Statistics about a delta and the search that produced it.

  • literal_bytes, literal_commands - data carried in the delta itself.
  • copy_bytes, copy_commands - data taken from the basis.
  • weak_hits - windows whose weak checksum appeared in the signature; each costs one strong hash.
  • false_weak_hits - weak hits whose strong hash matched no block.

literal_bytes + copy_bytes is the size of the rebuilt data. The search counters are nil when the statistics are computed from a delta alone (Rexd.Delta.stats/1), since the search is not known then.

A high false_weak_hits relative to the input size points to data crafted against the signature (see the notes on untrusted input) or to a very short strong_sum_len being unnecessary: false hits cost time, not correctness.

Summary

Types

t()

@type t() :: %Rexd.Delta.Stats{
  copy_bytes: non_neg_integer(),
  copy_commands: non_neg_integer(),
  false_weak_hits: non_neg_integer() | nil,
  literal_bytes: non_neg_integer(),
  literal_commands: non_neg_integer(),
  weak_hits: non_neg_integer() | nil
}