Kozai::Assets::Asset
A file served straight from the binary.
Constructors
Class methods
FNV-1a, 64-bit. Chosen because it is eight lines and needs nothing: a digest from the standard library would drag in a C library, which is exactly what this project does not do. Collisions do not matter here — the alternative to a weak checksum is no checksum at all.
Instance methods
etag
Entity tag for this content, quoted and ready to send.
NOTE: derived from the bytes, not from the version. A browser that
cached an asset must be able to find out that it changed, and during
development the version does not move while the file does. String#hash
is unsuitable — Crystal seeds it randomly per process, so it would
invalidate every cache on every restart.