<commit_before>'use strict'

const pad = (str, size) => (new Array(size + 1).join('0') + str).slice(-size)

const globalCount = (() => {
  let count = 0
  const window = window || global

  for (let i in window) {
    count++
  }

  return count
}())

const navi = navigator.mimeTypes.length + navigator.userAgent.length

const fingerprint = pad(navi.toString(36) + globalCount.toString(36), 4)

export default () => fingerprint<commit_msg>update random/fingerprint-browser add comments. prep for deprecation<commit_after>// https://github.com/therealklanni/browser-fingerprint (MIT)
// this module will be deprecated in this library. use actual module
// for use in the browser

'use strict'

const pad = (str, size) => (new Array(size + 1).join('0') + str).slice(-size)

const globalCount = () => {
  let count = 0
  const window = window || global

  for (let i in window) {
    count++
  }

  return count
}

// for testing purposes only!!!
let ver = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3`
let platform = `AppleWebKit/537.36 (KHTML, like Gecko)`
let ext = `Chrome/43.0.2357.130 Safari/537.36`

global.navigator = {
  mimeTypes: new Array(8),
  userAgent: `${ver} ${platform} ${ext}`
}

const navi = navigator.mimeTypes.length + navigator.userAgent.length

const fingerprint = pad(navi.toString(36) + globalCount.toString(36), 4)

module.exports = () => fingerprint
{'fraction_non_alphanumeric': 0.14658925979680695, 'fraction_numerical': 0.03193033381712627, 'mean_word_length': 3.942652329749104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 1, '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': '2956360', 'n_tokens_mistral': 493, 'n_tokens_neox': 452, 'n_words': 132}