MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / uuid_from_guid

Function uuid_from_guid

block/src/vhdx/mod.rs:239–249  ·  view source on GitHub ↗
(buf: &[u8])

Source from the content-addressed store, hash-verified

237}
238
239pub(crate) fn uuid_from_guid(buf: &[u8]) -> Uuid {
240 // The first 3 fields of UUID are stored in Big Endian format, and
241 // the last 8 bytes are stored as byte array. Therefore, we read the
242 // first 3 fields in Big Endian format instead of Little Endian.
243 Uuid::from_fields_le(
244 BigEndian::read_u32(&buf[0..4]),
245 BigEndian::read_u16(&buf[4..6]),
246 BigEndian::read_u16(&buf[6..8]),
247 buf[8..16].try_into().unwrap(),
248 )
249}

Callers 2

newMethod · 0.85
newMethod · 0.85

Calls 1

try_intoMethod · 0.80

Tested by

no test coverage detected