MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / encode_zorder_prefix

Function encode_zorder_prefix

nodedb-array/src/coord/encode.rs:26–30  ·  view source on GitHub ↗

Encode a Z-order prefix for one cell coordinate.

(schema: &ArraySchema, coord: &[CoordValue])

Source from the content-addressed store, hash-verified

24
25/// Encode a Z-order prefix for one cell coordinate.
26pub fn encode_zorder_prefix(schema: &ArraySchema, coord: &[CoordValue]) -> ArrayResult<u64> {
27 let bits = normalize::bits_per_dim(schema.arity());
28 let normalized = normalize::normalize_coord(schema, coord, bits)?;
29 zorder::encode(&normalized, bits)
30}
31
32/// Encode whichever space-filling curve the schema declares for cells.
33pub fn encode_cell_prefix(schema: &ArraySchema, coord: &[CoordValue]) -> ArrayResult<u64> {

Callers 2

encode_cell_prefixFunction · 0.85

Calls 4

bits_per_dimFunction · 0.85
normalize_coordFunction · 0.85
encodeFunction · 0.70
arityMethod · 0.45