<commit_before>#ifndef SERIALHASHER_H
#define SERIALHASHER_H
#include <openssl/sha.h>
#include <stddef.h>
#include <string>

class SerialHasher {
 public:
  SerialHasher() {}
  ~SerialHasher() {}

  virtual size_t DigestSize() const = 0;
  virtual void Reset() = 0;
  virtual void Update(const std::string &data) = 0;
  virtual std::string Final() = 0;
};

class Sha256Hasher : public SerialHasher {
 public:
  Sha256Hasher();

  size_t DigestSize() const { return kDigestSize; }

  void Reset();
  void Update(const std::string &data);
  std::string Final();

 private:
  SHA256_CTX ctx_;
  bool initialized_;
  static const size_t kDigestSize;
};
#endif
<commit_msg>Make SerialHasher's d'tor virtual.<commit_after>#ifndef SERIALHASHER_H
#define SERIALHASHER_H
#include <openssl/sha.h>
#include <stddef.h>
#include <string>

class SerialHasher {
 public:
  SerialHasher() {}
  virtual ~SerialHasher() {}

  virtual size_t DigestSize() const = 0;
  virtual void Reset() = 0;
  virtual void Update(const std::string &data) = 0;
  virtual std::string Final() = 0;
};

class Sha256Hasher : public SerialHasher {
 public:
  Sha256Hasher();

  size_t DigestSize() const { return kDigestSize; }

  void Reset();
  void Update(const std::string &data);
  std::string Final();

 private:
  SHA256_CTX ctx_;
  bool initialized_;
  static const size_t kDigestSize;
};
#endif

{'fraction_non_alphanumeric': 0.12380952380952381, 'fraction_numerical': 0.01904761904761905, 'mean_word_length': 4.739495798319328, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2463931', 'n_tokens_mistral': 493, 'n_tokens_neox': 467, 'n_words': 130}