module

Plombir::Assets::Fingerprint

Pure content hashing plus filename stamping. No disk writes here; Assets::Pipeline owns the walk/emit/manifest side.

hash = Plombir::Assets::Fingerprint.hash8("body { color: red; }")
Plombir::Assets::Fingerprint.stamped("style.css", hash)
# => "style.a1b2c3d4.css" (hash value differs)

Constants

HASH_LENGTH = 8

Hex characters kept from the SHA256 digest (SHA256-8 per roadmap).

Class methods

hash8(content : String) : String

Hashes content to HASH_LENGTH lowercase hex characters.

Source
hash_file(path : String) : String

Hashes the file at path (read as bytes-through-String, same as Build::Incremental.hash_file, so text and binary agree).

Source
stamped(relative : String, hash : String) : String

Inserts hash before the extension: style.css → style.<hash>.css, preserving subdirectories (css/site.css → css/site.<hash>.css). Extensionless names get the hash appended (robots → robots.<hash>).

Source