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

Function decode_session_turn_key

atomic-core/src/change/session.rs:762–766  ·  view source on GitHub ↗
(key: &[u8; 40])

Source from the content-addressed store, hash-verified

760/// Decode a session turn key.
761#[inline]
762pub fn decode_session_turn_key(key: &[u8; 40]) -> ([u8; 32], u32) {
763 let session_id = key[0..32].try_into().unwrap();
764 let turn_number = u32::from_be_bytes(key[36..40].try_into().unwrap());
765 (session_id, turn_number)
766}
767
768/// Derive the local ordered-index prefix for an external session ID.
769#[inline]

Callers 1

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected