Skip to main content

interop_key

Function interop_key 

Source
pub fn interop_key(
    namespace: &str,
    operation: &str,
    args: &[InteropValue],
) -> Result<String, CachekitError>
Expand description

Generate an interop/v1 cache key: {namespace}:{operation}:{args_hash}.

args_hash is Blake2b-256 (32-byte digest, unkeyed, lowercase hex) over canonical_args of the flat argument array. The maximum possible key length is 194 characters, so the auto-mode truncation rule never applies.

§Errors

  • CachekitError::InvalidKey if namespace or operation fails the segment grammar (rejected, never normalized), or namespace is the reserved ns or nsapi.
  • CachekitError::Serialization if any argument is outside the interop data model’s ranges (non-finite float, integer outside [-2^63, 2^64-1]).