What is a public key token and how is it calculated in assembly strong names?

Praveen Sharma picture Praveen Sharma · Feb 21, 2009 · Viewed 24.4k times · Source

What is a 'public key token' and how is it calculated in assembly strong names?

Answer

Cerebrus picture Cerebrus · Feb 21, 2009

Regarding your question, "How is it calculated", it's an SHA1 hash.

From dot net blog:

Microsoft solves the "public key bloat" problem by using a hash of the strongly-named assembly's public key. These hashes are referred to as public key tokens, and are the low 8 bytes of the SHA1 hash of the strongly-named assembly's public key. SHA1 hashes are 160 bit (20 byte) hashes, and the top 12 bytes of the hash are simply discarded in this algorithm.