<commit_before>#include "qt_download.hpp"
#include "qt_download_manager.hpp"

#include "../base/logging.hpp"
#include "../base/assert.hpp"

#include "../version/version.hpp"

#include "../std/target_os.hpp"

#include <QNetworkInterface>
#include <QFSFileEngine>
#include <QDateTime>

// How many times we try to automatically reconnect in the case of network errors
#define MAX_AUTOMATIC_RETRIES 2

/// @return mac address of active interface without colons or empty string if not found
/// @note mac is converted to decimal from hex
static QString MacAddress()
{
  QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
  for (int i = 0; i < interfaces.size(); ++i)
  {
    QNetworkInterface const & iface = interfaces.at(i);
    QString hwAddr = iface.hardwareAddress();
    if (!iface.addressEntries().empty()
      && (iface.flags() & (QNetworkInterface::IsUp | QNetworkInterface::IsRunning
                           | QNetworkInterface::CanBroadcast | QNetworkInterface::CanMulticast))
         == iface.flags()
      && hwAddr.size() == 17) // mac length with semicolons
    {
      hwAddr.remove(':');
      bool success = false;
      qulonglong numAddr = hwAddr.toULongLong(&success, 16);
      if (success)
        return QString("%1").arg(numAddr);
    }
  }
  // no valid interface was found
  return QString();
}<commit_msg>Slightly "crypted" mac<commit_after>#include "qt_download.hpp"
#include "qt_download_manager.hpp"

#include "../base/logging.hpp"
#include "../base/assert.hpp"

#include "../coding/bit_shift.hpp"

#include "../version/version.hpp"

#include "../std/target_os.hpp"

#include <QNetworkInterface>
#include <QFSFileEngine>
#include <QDateTime>

// How many times we try to automatically reconnect in the case of network errors
#define MAX_AUTOMATIC_RETRIES 2

/// @return mac address of active interface without colons or empty string if not found
/// @note mac is converted to decimal from hex and slightly crypted
static QString MacAddress()
{
  QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
  for (int i = 0; i < interfaces.size(); ++i)
  {
    QNetworkInterface const & iface = interfaces.at(i);
    QString hwAddr = iface.hardwareAddress();
    if (!iface.addressEntries().empty()
      && (iface.flags() & (QNetworkInterface::IsUp | QNetworkInterface::IsRunning
                           | QNetworkInterface::CanBroadcast | QNetworkInterface::CanMulticast))
         == iface.flags()
      && hwAddr.size() == 17) // mac length with semicolons
    {
      hwAddr.remove(':');
      bool success = false;
      qulonglong numAddr = hwAddr.toULongLong(&success, 16);
      numAddr = bits::ror(numAddr, 11);
      if (success)
        return QString("%1").arg(numAddr);
    }
  }
  // no valid interface was found
  return QString();
}
{'fraction_non_alphanumeric': 0.13156028368794326, 'fraction_numerical': 0.005673758865248227, 'mean_word_length': 3.535369774919614, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4299204', 'n_tokens_mistral': 856, 'n_tokens_neox': 838, 'n_words': 230}