I am learning how the bitTorrent and Bencoded dictionary of bitTorrent. But I don't understand how the pieces
are encoded in SHA-1
in the torrent metainfo file. As from my knowledge SHA-1 hash is look like this aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
, but instead it look like this KÅ•Š8yç=¾4f¯gBûõÿm¶¤lâFiÔ
Somebody tell me what is this?
Asked
Active
Viewed 426 times
1

Aslam
- 683
- 1
- 7
- 20
1 Answers
1
No, your assumption is wrong. SHA-1 doesn't "look like this aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
" as hash functions returns just list of bytes. What you have seen as KÅ•Š8yç=¾4f¯gBûõÿm¶¤lâFiÔ
is just output of that function which your viewer tries to output as a text, which obviously fails.

Hauleth
- 22,873
- 4
- 61
- 112
-
so if hash return list of bytes then how this happens `aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d` I just used a website to hash 'Hello World' string – Aslam Jan 05 '17 at 17:11
-
1This is list of hexadecimal representations of each byte. As each byte can be represented as exactly 2 hexadecimal digits it is easy way to represent it as long hexadecimal number. – Hauleth Jan 05 '17 at 17:13
-
1hex is an *encoding*, just like url escaping, base64 and similar. – the8472 Jan 05 '17 at 17:16
-
It is possible to convert `KÅ•Š8yç=¾4f¯gBûõÿm¶¤lâFiÔ` to more eye friendly hexadecimal representation – Aslam Jan 05 '17 at 17:25