Skip to content

Instantly share code, notes, and snippets.

@rido-min
Last active June 3, 2022 02:51
Show Gist options
  • Save rido-min/0fbba66c8fd312632fc6523ab1503701 to your computer and use it in GitHub Desktop.
Save rido-min/0fbba66c8fd312632fc6523ab1503701 to your computer and use it in GitHub Desktop.
ComputeDeviceKey
internal static string ComputeDeviceKey(string masterKey, string deviceId) =>
Convert.ToBase64String(new System.Security.Cryptography.HMACSHA256(Convert.FromBase64String(masterKey)).ComputeHash(System.Text.Encoding.UTF8.GetBytes(deviceId)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment