コード例 #1
0
        public static FileIdentity IdentifyFile(string path)
        {
            long filesize;

            byte[] shorthash;
            byte[] hash;
            using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read)) {
                filesize  = fs.Length;
                shorthash = HashUtil.CalculateShortHash(fs);
                hash      = HashUtil.CalculateHash(fs);
            }
            return(new FileIdentity(filesize, shorthash, hash));
        }