<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace DeviceId
{
    /// <summary>
    /// Provides a fluent interface for constructing unique device identifiers.
    /// </summary>
    public sealed class DeviceIdBuilder
    {
        /// <summary>
        /// The name of the default hash algorithm to use if nothing else is specified.
        /// </summary>
        private const string DefaultHashAlgorithm = "SHA256";

        /// <summary>
        /// The comparer to use when comparing components for equality.
        /// </summary>
        private static IEqualityComparer<IDeviceIdComponent> _comparer;

        /// <summary>
        /// A HashSet containing the components that will make up the device identifier.
        /// </summary>
        private readonly HashSet<IDeviceIdComponent> _components;

        /// <summary>
        /// Initializes static members of the <see cref="DeviceIdBuilder"/> class.
        /// </summary>
        static DeviceIdBuilder()
        {
            _comparer = new DeviceIdComponentEqualityComparer();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DeviceIdBuilder"/> class.
        /// </summary>
        public DeviceIdBuilder()
        {
            _components = new HashSet<IDeviceIdComponent>(_comparer);
        }

        /// <summary>
        /// Adds the specified component to this <see cref="DeviceIdBuilder"/> instance.
        /// The component will be used to construct the device identifier.
        /// </summary>
        /// <param name="component">The component to be added.</param>
        /// <returns>This DeviceIdBuilder instance.</returns>
        public DeviceIdBuilder AddComponent(IDeviceIdComponent component)
        {
            _components.Add(component);
            return this;
        }

        /// <summary>
        /// Returns a unique identifier for this device, using the components specified
        /// in this <see cref="DeviceIdBuilder"/> instance.
        /// </summary>
        /// <returns>A unique identifier for this device.</returns>
        public byte[] ToByteArray()
        {<commit_msg>Fix static member naming convention.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace DeviceId
{
    /// <summary>
    /// Provides a fluent interface for constructing unique device identifiers.
    /// </summary>
    public sealed class DeviceIdBuilder
    {
        /// <summary>
        /// The name of the default hash algorithm to use if nothing else is specified.
        /// </summary>
        private const string DefaultHashAlgorithm = "SHA256";

        /// <summary>
        /// The comparer to use when comparing components for equality.
        /// </summary>
        private static IEqualityComparer<IDeviceIdComponent> comparer;

        /// <summary>
        /// A HashSet containing the components that will make up the device identifier.
        /// </summary>
        private readonly HashSet<IDeviceIdComponent> _components;

        /// <summary>
        /// Initializes static members of the <see cref="DeviceIdBuilder"/> class.
        /// </summary>
        static DeviceIdBuilder()
        {
            comparer = new DeviceIdComponentEqualityComparer();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DeviceIdBuilder"/> class.
        /// </summary>
        public DeviceIdBuilder()
        {
            _components = new HashSet<IDeviceIdComponent>(comparer);
        }

        /// <summary>
        /// Adds the specified component to this <see cref="DeviceIdBuilder"/> instance.
        /// The component will be used to construct the device identifier.
        /// </summary>
        /// <param name="component">The component to be added.</param>
        /// <returns>This DeviceIdBuilder instance.</returns>
        public DeviceIdBuilder AddComponent(IDeviceIdComponent component)
        {
            _components.Add(component);
            return this;
        }

        /// <summary>
        /// Returns a unique identifier for this device, using the components specified
        /// in this <see cref="DeviceIdBuilder"/> instance.
        /// </summary>
        /// <returns>A unique identifier for this device.</returns>
        public byte[] ToByteArray()
        {
{'fraction_non_alphanumeric': 0.10786065207682001, 'fraction_numerical': 0.0013398838767306833, 'mean_word_length': 2.046938775510204, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, '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': '2207620', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1053, 'n_words': 356}