I'm trying to get a short unique ID for a machine. What I'm currently doing is this:
string mac = GetMacAddress();
mac = mac.Substring(2,2) + mac.Substring(6);
// We dont care about most of the vendor bit
SHA1Managed sha = new SHA1Managed();
string hash = Convert.ToBase64String(sha.ComputeHash(
Encoding.Default.GetBytes(mac)));
_uniqueId = hash.Replace("=", string.Empty).Replace("+", string.Empty)
.Replace("/", string.Empty).Remove(6);
sha.Dispose();
Obviously it isn't ideal but is this ok? Is there a better portion of the SHA1 hash to use? Or does anyone have any better ideas?