Exemplo n.º 1
0
 /// <summary>
 /// Convert a 6-byte (48-bit) MAC address to the trailing 6-bytes of a GUID
 /// </summary>
 /// <param name="address"></param>
 /// <returns></returns>
 public static Guid AddressToGuid( Byte[] address )
 {
    if(address.IsNullOrEmptyOrNullByte() || address.Length != 6)
    {
       throw new ArgumentException( "Address must be an array of 6 bytes." );
    }
    return
       new Guid(
          new Byte[]
          {
             0,
             0,
             0,
             0,
             0,
             0,
             0,
             0,
             0,
             0,
             address[0],
             address[1],
             address[2],
             address[3],
             address[4],
             address[5]
          } );
 }