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

Function encode_surrogates

nodedb-array/src/codec/column_codec.rs:32–35  ·  view source on GitHub ↗
(surrogates: &[Surrogate])

Source from the content-addressed store, hash-verified

30// ---------------------------------------------------------------------------
31
32pub fn encode_surrogates(surrogates: &[Surrogate]) -> Vec<u8> {
33 let as_i64: Vec<i64> = surrogates.iter().map(|s| s.as_u32() as i64).collect();
34 nodedb_codec::fastlanes::encode(&as_i64)
35}
36
37pub fn decode_surrogates(data: &[u8]) -> ArrayResult<Vec<Surrogate>> {
38 let as_i64 = nodedb_codec::fastlanes::decode(data).map_err(codec_err)?;

Callers 4

surrogates_roundtripFunction · 0.85
encode_structuralFunction · 0.85

Calls 4

collectMethod · 0.80
encodeFunction · 0.50
iterMethod · 0.45
as_u32Method · 0.45

Tested by 3

surrogates_roundtripFunction · 0.68