MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / encode_session_turn_key

Function encode_session_turn_key

atomic-core/src/change/session.rs:753–758  ·  view source on GitHub ↗
(session_id: [u8; 32], turn_number: u32)

Source from the content-addressed store, hash-verified

751/// Encode `(session_namespace, turn_number)` for ordered Redb scans.
752#[inline]
753pub fn encode_session_turn_key(session_id: [u8; 32], turn_number: u32) -> [u8; 40] {
754 let mut key = [0u8; 40];
755 key[0..32].copy_from_slice(&session_id);
756 key[36..40].copy_from_slice(&turn_number.to_be_bytes());
757 key
758}
759
760/// Decode a session turn key.
761#[inline]

Callers 7

get_session_turnsMethod · 0.85
append_session_turnMethod · 0.85
rewrite_session_turnsMethod · 0.85
attach_turn_boundaryMethod · 0.85
turn_keyFunction · 0.85

Calls

no outgoing calls