<commit_before>﻿using System;
using System.IO;
using System.Security.Cryptography;

namespace Futilities.FileIO
{
    public static partial class FileIO
    {
        public static string GetFileCheckSum(this FileInfo File, HashingAlgorithm hashingAlgorithm = HashingAlgorithm.MD5)
        {
            if (File is null)
                throw new ArgumentNullException(nameof(File));

            if (!File.Exists)
                throw new FileNotFoundException("Unable to locate file", File.Name);

            using var stream = new BufferedStream(File.OpenRead(), 1500000);

            switch (hashingAlgorithm)
            {
                case HashingAlgorithm.MD5:
                    using (var md5 = MD5.Create())
                    {
                        return BitConverter.ToString(md5.ComputeHash(stream));
                    }

                case HashingAlgorithm.SHA1:
                    using (var sha1 = SHA1.Create())
                    {
                        return BitConverter.ToString(sha1.ComputeHash(stream));
                    }
                default:<commit_msg>Removed "partial" keyword from "FileIO.cs"<commit_after>﻿using System;
using System.IO;
using System.Security.Cryptography;

namespace Futilities.FileIO
{
    public static class FileIO
    {
        public static string GetFileCheckSum(this FileInfo File, HashingAlgorithm hashingAlgorithm = HashingAlgorithm.MD5)
        {
            if (File is null)
                throw new ArgumentNullException(nameof(File));

            if (!File.Exists)
                throw new FileNotFoundException("Unable to locate file", File.Name);

            using var stream = new BufferedStream(File.OpenRead(), 1500000);

            switch (hashingAlgorithm)
            {
                case HashingAlgorithm.MD5:
                    using (var md5 = MD5.Create())
                    {
                        return BitConverter.ToString(md5.ComputeHash(stream));
                    }

                case HashingAlgorithm.SHA1:
                    using (var sha1 = SHA1.Create())
                    {
                        return BitConverter.ToString(sha1.ComputeHash(stream));
                    }
                default:
{'fraction_non_alphanumeric': 0.07651006711409396, 'fraction_numerical': 0.014317673378076063, 'mean_word_length': 1.6030267753201397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5380157', 'n_tokens_mistral': 562, 'n_tokens_neox': 515, 'n_words': 128}