(buf: &[u8])
| 237 | } |
| 238 | |
| 239 | pub(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 | } |