<commit_before>﻿using FonctionsUtiles.Fred.Csharp;
using System;

namespace ConsoleAppNTLM
{
  class Program
  {
    static void Main(string[] args)
    {
      Action<string> display = Console.WriteLine;
      string alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&é'(-è_çà)=$£*%â";
      for (int i = 0; i < alphabet.Length; i++)
      {
        display($"{alphabet[i]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString())}");
      }

      display("Press any key to exit:");
      Console.ReadKey();
    }
  }
}<commit_msg>Add code to calculate NTLM hashes<commit_after>﻿using FonctionsUtiles.Fred.Csharp;
using System;
using System.Collections.Generic;

namespace ConsoleAppNTLM
{
  class Program
  {
    static void Main()
    {
      Action<string> display = Console.WriteLine;
      ulong count = 0;
      bool addToListe = false;
      List<string> liste = new List<string>();
      string alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&é'(-è_çà)=$£*%âêîôûù,;:!?./\\§%µä+°€@<>";
      for (int i = 0; i < alphabet.Length; i++)
      {
        count++;
        display($"{alphabet[i]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString())}");
        if (addToListe)
        {
          liste.Add($"{alphabet[i]};{FunctionsCrypto.Ntlm(alphabet[i].ToString())}");
        }
      }

      // 101 NTLM calculated so far with 1 character
      for (int i = 0; i < alphabet.Length; i++)
      {
        for (int j = 0; j < alphabet.Length; j++)
        {
          count++;
          display($"{alphabet[i]}{alphabet[j]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString())}");
          if (addToListe)
          {
            liste.Add($"{alphabet[i]}{alphabet[j]};{FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString())}");
          }
        }
      }

      //// 10 302 NTLM calculated so far with 2 characters
      for (int i = 0; i < alphabet.Length; i++)
      {
        for (int j = 0; j < alphabet.Length; j++)
        {
          for (int k = 0; k < alphabet.Length; k++)
          {
            count++;
            display($"{alphabet[i]}{alphabet[j]}{alphabet[k]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString())}");
            if (addToListe)
            {
              liste.Add($"{alphabet[i]}{alphabet[j]}{alphabet[k]};{FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString())}");
            }
          }
        }
      }

      //// 1 040 603 NTLM calculated so far with 3 characters
      for (int i = 0; i < alphabet.Length; i++)
      {
        for (int j = 0; j < alphabet.Length; j++)
        {
          for (int k = 0; k < alphabet.Length; k++)
          {
            for (int l = 0; l < alphabet.Length; l++)
            {
              count++;
              display($"{alphabet[i]}{alphabet[j]}{alphabet[k]}{alphabet[l]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString() + alphabet[l].ToString())}");
              if (addToListe)
              {
                liste.Add($"{alphabet[i]}{alphabet[j]}{alphabet[k]}{alphabet[l]} = {FunctionsCrypto.Ntlm(alphabet[i].ToString() + alphabet[j].ToString() + alphabet[k].ToString() + alphabet[l].ToString())}");
              }
            }
          }
        }
      }

      // 105 101 004 NTLM calculated so far with 4 characters //out of memory error at 3.6 GB console app if addToListe = true
      display(string.Empty);
      display($"There are {count} NTLM hash calculated.");
      display(string.Empty);
      display("Press any key to exit:");
      Console.ReadKey();
    }
  }
}
{'fraction_non_alphanumeric': 0.1677052289352479, 'fraction_numerical': 0.01679761582227039, 'mean_word_length': 2.3624772313296902, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 8, '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': '629907', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1226, 'n_words': 237}