Skip to contents

Generates a lightweight content signature by hashing sampled byte regions from a file. The signature provides a fast operational approximation for detecting identical or differing file instances without computing a full cryptographic hash.

Usage

quick_signature(path, n = 1024)

Arguments

path

Character. Path to the file.

n

Integer. Number of bytes sampled from selected regions (default: 1024).

Value

Character. A lightweight operational signature.

Details

The function is designed for large-scale observational workflows where complete file hashing would be unnecessarily expensive.

The signature is constructed by hashing sampled byte regions:

  • small files: full file content

  • medium files: beginning and end

  • large files: beginning, middle and end

The resulting signature is intended as a fast observational aid:

  • identical signatures suggest identical file content;

  • differing signatures indicate differing file content;

  • collisions are possible but unlikely in operational use.

Missing or inaccessible files return NA_character_.

The signature does not establish authoritative identity or provenance. It provides lightweight observational evidence that may support later contextual reconstruction, duplicate detection, version analysis, or Record Set construction.

Unlike quick_signature_text(), this function operates on the binary representation of a file rather than its textual content.