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

Method to_bytes

atomic-core/src/crdt/ids.rs:90–95  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

88 /// Encodes as 12 bytes for storage.
89 #[inline]
90 pub fn to_bytes(&self) -> [u8; 12] {
91 let mut bytes = [0u8; 12];
92 bytes[0..8].copy_from_slice(&self.change_id.get().to_le_bytes());
93 bytes[8..12].copy_from_slice(&self.file_idx.to_le_bytes());
94 bytes
95 }
96
97 /// Decodes from 12 bytes.
98 #[inline]

Callers 6

signMethod · 0.45

Calls 2

to_le_bytesMethod · 0.80
getMethod · 0.65