Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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);
        }