<commit_before>using System;
using System.Collections.Generic;
using System.Text;
using MonoTorrent.Common;
using System.Web;

namespace MonoTorrent
{
    public class InfoHash : IEquatable <InfoHash>
    {
        byte[] hash;

        internal byte[] Hash
        {
            get { return hash; }
        }

        public InfoHash(byte[] infoHash)
        {
            Check.InfoHash(infoHash);
            if (infoHash.Length != 20)
                throw new ArgumentException("Infohash must be exactly 20 bytes long");
            hash = (byte[])infoHash.Clone();
        }

        public override bool Equals(object obj)
        {
            return Equals(obj as InfoHash);
        }

        public bool Equals(byte[] other)
        {
            return other == null || other.Length != 20 ? false : Toolbox.ByteMatch(Hash, other);
        }

        public bool Equals(InfoHash other)
        {
            return this == other;
        }

        public override int GetHashCode()
        {
            // Equality is based generally on checking 20 positions, checking 4 should be enough
            // for the hashcode as infohashes are randomly distributed.
            return Hash[0] | (Hash[1] << 8) | (Hash[2] << 16) | (Hash[3] << 24);
        }

        public string ToHex()
        {
            return Toolbox.ToHex(Hash);
        }

        public override string ToString()
        {
            return BitConverter.ToString(hash);<commit_msg>Add  helper method to return a copy of the byte[] in the InfoHash object<commit_after>using System;
using System.Collections.Generic;
using System.Text;
using MonoTorrent.Common;
using System.Web;

namespace MonoTorrent
{
    public class InfoHash : IEquatable <InfoHash>
    {
        byte[] hash;

        internal byte[] Hash
        {
            get { return hash; }
        }

        public InfoHash(byte[] infoHash)
        {
            Check.InfoHash(infoHash);
            if (infoHash.Length != 20)
                throw new ArgumentException("Infohash must be exactly 20 bytes long");
            hash = (byte[])infoHash.Clone();
        }

        public override bool Equals(object obj)
        {
            return Equals(obj as InfoHash);
        }

        public bool Equals(byte[] other)
        {
            return other == null || other.Length != 20 ? false : Toolbox.ByteMatch(Hash, other);
        }

        public bool Equals(InfoHash other)
        {
            return this == other;
        }

        public override int GetHashCode()
        {
            // Equality is based generally on checking 20 positions, checking 4 should be enough
            // for the hashcode as infohashes are randomly distributed.
            return Hash[0] | (Hash[1] << 8) | (Hash[2] << 16) | (Hash[3] << 24);
        }

        public byte[] ToArray()
        {
            return (byte[])hash.Clone();
        }

        public string ToHex()
        {
            return Toolbox.ToHex(Hash);
        }

        public override string ToString()
        {
            return BitConverter.ToString(hash);
{'fraction_non_alphanumeric': 0.09582389122693429, 'fraction_numerical': 0.01165425704111363, 'mean_word_length': 1.7296819787985867, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 5, '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': '6030021', 'n_tokens_mistral': 842, 'n_tokens_neox': 799, 'n_words': 247}