pub fn bytes_to_guid(bytes: [u8; 16]) -> Guid {
    // convert the bytes to usable values
    let time_low = u32::from_ne_bytes(bytes[0..4].try_into().unwrap());
    let time_mid = u16::from_ne_bytes(bytes[4..6].try_into().unwrap());
    let time_high = u16::from_ne_bytes(bytes[6..8].try_into().unwrap());
    let clock_seq = u16::from_ne_bytes(bytes[8..10].try_into().unwrap());
    let node: [u8; 6] = bytes[10..16].try_into().unwrap();

    // generate the GUID structure
    Guid::from_values(
        time_low, 
        time_mid, 
        time_high, 
        clock_seq, 
        node
    )
}
/// helper function to parse GUIDs from raw bytes
helper function to parse GUIDs from raw bytes
helper function to parse GUIDs from raw bytes
pub fn bytes_to_guid(bytes: [u8; 16]) -> Guid {
    // convert the bytes to usable values
    let time_low = u32::from_ne_bytes(bytes[0..4].try_into().unwrap());
    let time_mid = u16::from_ne_bytes(bytes[4..6].try_into().unwrap());
    let time_high = u16::from_ne_bytes(bytes[6..8].try_into().unwrap());
    let clock_seq = u16::from_ne_bytes(bytes[8..10].try_into().unwrap());
    let node: [u8; 6] = bytes[10..16].try_into().unwrap();
    // generate the GUID structure
    Guid::from_values(
        time_low, 
        time_mid, 
        time_high, 
        clock_seq, 
        node
    )
}
pub fn bytes_to_guid ( bytes : [ u8 ; 16 ] ) -> Guid { // convert the bytes to usable values let time_low = u32 :: from_ne_bytes ( bytes [ 0 .. 4 ] . try_into ( ) . unwrap ( ) ) ; let time_mid = u16 :: from_ne_bytes ( bytes [ 4 .. 6 ] . try_into ( ) . unwrap ( ) ) ; let time_high = u16 :: from_ne_bytes ( bytes [ 6 .. 8 ] . try_into ( ) . unwrap ( ) ) ; let clock_seq = u16 :: from_ne_bytes ( bytes [ 8 .. 10 ] . try_into ( ) . unwrap ( ) ) ; let node : [ u8 ; 6 ] = bytes [ 10 .. 16 ] . try_into ( ) . unwrap ( ) ; // generate the GUID structure Guid :: from_values ( time_low , time_mid , time_high , clock_seq , node ) }
helper function to parse GUIDs from raw bytes
helper function to parse GUIDs from raw bytes
bytes
[u8; 16]
bytes
[u8; 16]