Exemplo n.º 1
0
        private byte[] ComputeInfoHash(BencodedDictionary info)
        {
            var hasher   = SHA1.Create();
            var bencoded = info.ToBencodedString();
            var bytes    = bencoded.Select(c => (byte)c).ToArray();
            var hash     = hasher.ComputeHash(bytes);

            return(hash);
        }
Exemplo n.º 2
0
 private byte[] ComputeInfoHash(BencodedDictionary info)
 {
     SHA1 hasher = SHA1.Create();
     string bencoded = info.ToBencodedString();
     byte[] bytes = bencoded.Select(c => (byte) c).ToArray();
     byte[] hash = hasher.ComputeHash(bytes);
     return hash;
 }