Esempio n. 1
0
 private static void CheckHash(NodeOSDownloadData osDownloadData, byte[] data)
 {
     if (Encoders.Hex.EncodeData(Hashes.SHA256(data)) != osDownloadData.Hash)
     {
         throw new Exception("Hash of downloaded file does not match");
     }
 }
Esempio n. 2
0
        private static void CheckHash(NodeOSDownloadData osDownloadData, byte[] data)
        {
            var actual = Encoders.Hex.EncodeData(Hashes.SHA256(data));

            if (!actual.Equals(osDownloadData.Hash, StringComparison.OrdinalIgnoreCase))
            {
                throw new Exception($"Hash of downloaded file does not match (Expected: {osDownloadData.Hash}, Actual: {actual})");
            }
        }
        private static void CheckHash(NodeOSDownloadData osDownloadData, byte[] data)
        {
            var actual = Encoders.Hex.EncodeData(Hashes.SHA256(data));

            if (actual != osDownloadData.Hash)
            {
                throw new Exception($"Hash of downloaded file does not match (Expected: {osDownloadData.Hash}, Actual: {actual})");
            }
        }