<commit_before>﻿/*
 @ <NAME>
*/

using System;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;

namespace EasyKeeper {
    public static class VaultMarshal {
        private class Checksum {
            public const int HashSizeInBytes = 128 / 8;
            private readonly byte[] _data;

            public Checksum(byte[] data)
            {
                _data = data;
            }

            public byte[] Data
            {
                get {
                    return _data;
                }
            }
        }

        private const uint ProtocolVersion = 1U;<commit_msg>add equality semantics for Checksum<commit_after>﻿/*
 @ <NAME>
*/

using System;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;

namespace EasyKeeper {
    public static class VaultMarshal {
        private class Checksum : IEquatable<Checksum> {
            public const int HashSizeInBytes = 128 / 8;
            private readonly byte[] _data;

            public Checksum(byte[] data)
            {
                _data = data;
            }

            public byte[] Data
            {
                get {
                    return _data;
                }
            }

            public bool Equals(Checksum other)
            {
                if (ReferenceEquals(null, other)) {
                    return false;
                }

                if (ReferenceEquals(this, other)) {
                    return true;
                }

                return _data.SequenceEqual(other._data);
            }

            public override bool Equals(object other)
            {
                if (ReferenceEquals(null, other)) {
                    return false;
                }

                if (ReferenceEquals(this, other)) {
                    return true;
                }

                var otherChecksum = other as Checksum;

                return (otherChecksum != null) && Equals(otherChecksum);
            }

            public override int GetHashCode()
            {
                return (_data != null ? _data.GetHashCode() : 0);
            }

            public static bool operator==(Checksum lhs, Checksum rhs)
            {
                return Equals(lhs, rhs);
            }

            public static bool operator!=(Checksum lhs, Checksum rhs)
            {
                return !(lhs == rhs);
            }
        }

        private const uint ProtocolVersion = 1U;
{'fraction_non_alphanumeric': 0.0775340393343419, 'fraction_numerical': 0.00416036308623298, 'mean_word_length': 1.3040069686411149, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '178195', 'n_tokens_mistral': 673, 'n_tokens_neox': 634, 'n_words': 171}