private static string GetUUID(int id, string group, string name, DeviceGroupType deviceGroupType)
{
var SHA256 = new SHA256Managed();
var hash = new StringBuilder();
string mixedAttr = id.ToString() + group + name + ((int)deviceGroupType).ToString();
byte[] hashedBytes = SHA256.ComputeHash(Encoding.UTF8.GetBytes(mixedAttr), 0, Encoding.UTF8.GetByteCount(mixedAttr));
foreach (var b in hashedBytes) {
hash.Append(b.ToString("x2"));
}
// GEN indicates the UUID has been generated and cannot be presumed to be immutable
return "GEN-" + hash.ToString();
}