Why is a SHA-1 Hash 40 characters long if it is only 160 bit?

One hex character can only represent 16 different values, i.e. 4 bits. (16 = 24)

40 × 4 = 160.


And no, you need much more than 5 characters in base-36.

There are totally 2160 different SHA-1 hashes.

2160 = 1640, so this is another reason why we need 40 hex digits.

But 2160 = 36160 log362 = 3630.9482…, so you still need 31 characters using base-36.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)