public static string GetDeviceId() { var uniqueId = new DeviceExtendedPropertiesService().DeviceUniqueId; var hashedId = _crypt.CreateMD5(uniqueId); return(new Guid(hashedId).ToString()); }
private string GetLocalId(string serverId, string itemId) { var bytes = Encoding.UTF8.GetBytes(serverId + itemId); bytes = _cryptographyProvider.CreateMD5(bytes); return(BitConverter.ToString(bytes, 0, bytes.Length).Replace("-", string.Empty)); }
protected string GetConnectPasswordMd5(string password) { var bytes = Encoding.UTF8.GetBytes(password); bytes = CryptographyProvider.CreateMD5(bytes); var hash = BitConverter.ToString(bytes, 0, bytes.Length).Replace("-", string.Empty); return(hash); }
public static string GetConnectPasswordMd5(string password, ICryptographyProvider cryptographyProvider) { password = ConnectPassword.PerformPreHashFilter(password ?? string.Empty); var bytes = Encoding.UTF8.GetBytes(password); bytes = cryptographyProvider.CreateMD5(bytes); var hash = BitConverter.ToString(bytes, 0, bytes.Length).Replace("-", string.Empty); return(hash); }