<commit_before>require 'base64'
require 'digest/sha2'

module Related
  module Helpers

    # Generate a unique id
    def generate_id
      Base64.encode64(
        Digest::SHA256.digest("#{Time.now}-#{rand}")
      ).gsub('/','x').gsub('+','y').gsub('=','').strip[0..21]
    end

  end
end<commit_msg>Use MD5 instead of SHA to generate ids. Makes more sense and is faster.<commit_after>require 'base64'
require 'digest/md5'

module Related
  module Helpers

    # Generate a unique id
    def generate_id
      Base64.encode64(
        Digest::MD5.digest("#{Time.now}-#{rand}")
      ).gsub('/','x').gsub('+','y').gsub('=','').strip
    end

  end
end
{'fraction_non_alphanumeric': 0.1776416539050536, 'fraction_numerical': 0.033690658499234305, 'mean_word_length': 3.1923076923076925, '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': '199777', 'n_tokens_mistral': 239, 'n_tokens_neox': 226, 'n_words': 52}