Compute the canonical content address (lowercase hex Blake3) of arbitrary object bytes. Every object family keys itself with this, so the transport never needs to know an object's type to verify it: `content_key(bytes) == key` is a universal, type-agnostic integrity check.
(bytes: &[u8])
| 47 | /// never needs to know an object's type to verify it: `content_key(bytes) == |
| 48 | /// key` is a universal, type-agnostic integrity check. |
| 49 | pub fn content_key(bytes: &[u8]) -> ObjectKey { |
| 50 | blake3::hash(bytes).to_hex().to_string() |
| 51 | } |
| 52 | |
| 53 | /// Whether `bytes` hash to `key` — the content-addressed integrity check the |
| 54 | /// bare server runs on every `PUT /{family}/{key}` before storing. |