Skip to content

Instantly share code, notes, and snippets.

@Legends
Last active October 19, 2019 19:10
Show Gist options
  • Select an option

  • Save Legends/6407568cac5425bf1d195aa648422bcb to your computer and use it in GitHub Desktop.

Select an option

Save Legends/6407568cac5425bf1d195aa648422bcb to your computer and use it in GitHub Desktop.
var path = @"C:\Users\Admin\Documents\Visual Studio 2019\Projects\PuppeteerCSarpTest\bin\Debug\PuppeteerCSarpTest.exe";
AssemblyName an = AssemblyName.GetAssemblyName(path);
byte[] pt = an.GetPublicKeyToken();
pt = an.GetPublicKeyToken();
var length = pt.GetLength(0);
Console.WriteLine("9ad46d957f307217".Length);
for (int i = 0; i < length; i++)
{
Console.Write("{0:x2}", pt[i]); // each byte is two characters, just test with {0:x3}, {0:x4}, etc. to see the diff
}
// Output:
// length = 16
// converted byte by byte: 9ad46d957f307217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment