<commit_before># frozen_string_literal: true

require "digest"

class AnonymousBlock < ApplicationRecord
  belongs_to :user
  belongs_to :question, optional: true

  def self.get_identifier(ip)
    Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip)
  end
end<commit_msg>Allow anonymous blocks without an owner<commit_after># frozen_string_literal: true

require "digest"

class AnonymousBlock < ApplicationRecord
  belongs_to :user, optional: true
  belongs_to :question, optional: true

  def self.get_identifier(ip)
    Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip)
  end
end
{'fraction_non_alphanumeric': 0.08653846153846154, 'fraction_numerical': 0.01282051282051282, 'mean_word_length': 5.944444444444445, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5259848', 'n_tokens_mistral': 206, 'n_tokens_neox': 197, 'n_words': 46}