예제 #1
0
파일: FileCheck.cs 프로젝트: vla/HashFile
        public static string GetHash(string opt, Stream stream, Func<int, bool> func)
        {
            FileCheck check;

            switch (opt.ToLower()) {
                case "crc32":
                    check = new Crc32();
                    break;

                case "md5":
                    check = new FileMD5();
                    break;

                default:
                    check = new FileSha1();
                    break;
            }

            check.TransformBlock(stream, func);

            return check.Value;
        }