<commit_before>﻿using System;
using System.Security.Cryptography;
using System.Security.Policy;
using System.Text;
using System.Xml.Serialization;

namespace CountWordsPerLanguage
{
  public class LetterFrequency
  {
    [XmlElement]
    public string Language { get; set; }
    [XmlElement]
    public int FileHash { get; set; }
    [XmlElement]
    public int LetterA { get; set; }
    [XmlElement]
    public int LetterB { get; set; }
    [XmlElement]
    public int LetterC { get; set; }
    [XmlElement]
    public int LetterD { get; set; }
    [XmlElement]
    public int LetterE { get; set; }
    [XmlElement]
    public int LetterF { get; set; }
    [XmlElement]
    public int LetterG { get; set; }
    [XmlElement]
    public int LetterH { get; set; }
    [XmlElement]
    public int LetterI { get; set; }
    [XmlElement]
    public int LetterJ { get; set; }
    [XmlElement]
    public int LetterK { get; set; }
    [XmlElement]
    public int LetterL { get; set; }
    [XmlElement]
    public int LetterM { get; set; }
    [XmlElement]
    public int LetterN { get; set; }
    [XmlElement]
    public int LetterO { get; set; }
    [XmlElement]
    public int LetterP { get; set; }
    [XmlElement]
    public int LetterQ { get; set; }
    [XmlElement]
    public int LetterR { get; set; }
    [XmlElement]
    public int LetterS { get; set; }
    [XmlElement]
    public int LetterT { get; set; }
    [XmlElement]
    public int LetterU { get; set; }
    [XmlElement]
    public int LetterV { get; set; }
    [XmlElement]
    public int LetterW { get; set; }
    [XmlElement]
    public int LetterX { get; set; }
    [XmlElement]
    public int LetterY { get; set; }
    [XmlElement]
    public int LetterZ { get; set; }

    public LetterFrequency() // constructor without parameters required by XML Serialization
    {
      Language = "english";
    }

    public LetterFrequency(string language)
    {
      Language = language;
    }

    public void FeedLetters(int[] letterArray)
    {
      LetterA = letterArray[1];
      LetterB = letterArray[2];
      LetterC = letterArray[3];
      LetterD = letterArray[4];
      LetterE = letterArray[5];
      LetterF = letterArray[6];
      LetterG = letterArray[7];
      LetterH = letterArray[8];
      LetterI = letterArray[9];
      LetterJ = letterArray[10];
      LetterK = letterArray[11];
      LetterL = letterArray[12];
      LetterM = letterArray[13];
      LetterN = letterArray[14];
      LetterO = letterArray[15];
      LetterP = letterArray[16];
      LetterQ = letterArray[17];
      LetterR = letterArray[18];
      LetterS = letterArray[19];
      LetterT = letterArray[20];
      LetterU = letterArray[21];
      LetterV = letterArray[22];
      LetterW = letterArray[23];
      LetterX = letterArray[24];
      LetterY = letterArray[25];
      LetterZ = letterArray[26];
    }

    public void AddHash(string text)
    {
      byte[] buffer = Encoding.Default.GetBytes(text);
      var fileHash2 = SHA512.Create();
      fileHash2.ComputeHash(buffer);
      FileHash = fileHash2.GetHashCode();
    }

    private string RsaEncryption(string clearData)
    {
      CspParameters param = new CspParameters {KeyContainerName = "MyKeyContainer"};
      using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(param))
      {
        string plainText = clearData;
        byte[] plainData = Encoding.Default.GetBytes(plainText);
        byte[] encryptedData = rsa.Encrypt(plainData, false);
        string encryptedString = Convert.ToBase64String(encryptedData);
        return encryptedString;
      }
    }

    private string RsaDecryption(string encryptedData)
    {
      CspParameters param = new CspParameters {KeyContainerName = "MyKeyContainer"};
      using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(param))
      {
        byte[] encryptedBytes = Convert.FromBase64String(encryptedData);
        byte[] decryptedData = rsa.Decrypt(encryptedBytes, false);
        string plainData = Encoding.Default.GetString(decryptedData);
        return plainData;
      }
    }
  }
}<commit_msg>Add tags to XmlElement attributes<commit_after>﻿using System;
using System.Security.Cryptography;
using System.Text;
using System.Xml.Serialization;

namespace CountWordsPerLanguage
{
  public class LetterFrequency
  {
    [XmlElement("Language")]
    public string Language { get; set; }
    [XmlElement("FileHash")]
    public int FileHash { get; set; }
    [XmlElement("LetterA")]
    public int LetterA { get; set; }
    [XmlElement("LetterB")]
    public int LetterB { get; set; }
    [XmlElement("LetterC")]
    public int LetterC { get; set; }
    [XmlElement("LetterD")]
    public int LetterD { get; set; }
    [XmlElement("LetterE")]
    public int LetterE { get; set; }
    [XmlElement("LetterF")]
    public int LetterF { get; set; }
    [XmlElement("LetterG")]
    public int LetterG { get; set; }
    [XmlElement("LetterH")]
    public int LetterH { get; set; }
    [XmlElement("LetterI")]
    public int LetterI { get; set; }
    [XmlElement("LetterJ")]
    public int LetterJ { get; set; }
    [XmlElement("LetterK")]
    public int LetterK { get; set; }
    [XmlElement("LetterL")]
    public int LetterL { get; set; }
    [XmlElement("LetterM")]
    public int LetterM { get; set; }
    [XmlElement("LetterN")]
    public int LetterN { get; set; }
    [XmlElement("LetterO")]
    public int LetterO { get; set; }
    [XmlElement("LetterP")]
    public int LetterP { get; set; }
    [XmlElement("LetterQ")]
    public int LetterQ { get; set; }
    [XmlElement("LetterR")]
    public int LetterR { get; set; }
    [XmlElement("LetterS")]
    public int LetterS { get; set; }
    [XmlElement("LetterT")]
    public int LetterT { get; set; }
    [XmlElement("LetterU")]
    public int LetterU { get; set; }
    [XmlElement("LetterV")]
    public int LetterV { get; set; }
    [XmlElement("LetterW")]
    public int LetterW { get; set; }
    [XmlElement("LetterX")]
    public int LetterX { get; set; }
    [XmlElement("LetterY")]
    public int LetterY { get; set; }
    [XmlElement("LetterZ")]
    public int LetterZ { get; set; }

    public LetterFrequency() // constructor without parameters required by XML Serialization
    {
      Language = "english";
    }

    public LetterFrequency(string language)
    {
      Language = language;
    }

    public void FeedLetters(int[] letterArray)
    {
      LetterA = letterArray[1];
      LetterB = letterArray[2];
      LetterC = letterArray[3];
      LetterD = letterArray[4];
      LetterE = letterArray[5];
      LetterF = letterArray[6];
      LetterG = letterArray[7];
      LetterH = letterArray[8];
      LetterI = letterArray[9];
      LetterJ = letterArray[10];
      LetterK = letterArray[11];
      LetterL = letterArray[12];
      LetterM = letterArray[13];
      LetterN = letterArray[14];
      LetterO = letterArray[15];
      LetterP = letterArray[16];
      LetterQ = letterArray[17];
      LetterR = letterArray[18];
      LetterS = letterArray[19];
      LetterT = letterArray[20];
      LetterU = letterArray[21];
      LetterV = letterArray[22];
      LetterW = letterArray[23];
      LetterX = letterArray[24];
      LetterY = letterArray[25];
      LetterZ = letterArray[26];
    }

    public void AddHash(string text)
    {
      byte[] buffer = Encoding.Default.GetBytes(text);
      var fileHash2 = SHA512.Create();
      fileHash2.ComputeHash(buffer);
      FileHash = fileHash2.GetHashCode();
    }
  }
}
{'fraction_non_alphanumeric': 0.11608689857390377, 'fraction_numerical': 0.013594562175129948, 'mean_word_length': 2.8580976863753214, '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': '3616842', 'n_tokens_mistral': 2374, 'n_tokens_neox': 2283, 'n_words': 595}