<commit_before>module.exports = class ArrayUtil {

  // Generates array from given hex string
  static fromHex(hex) {
    const array = []
    for(var i = 0; i < hex.length; i += 2) {
      //value = hex[index]
      array.push(parseInt(hex.slice(index, index + 2), 16))
    }
    return array
  }

  // Converts given data to buffer
  static toBuffer(data) {
    const buffer = new Buffer(data.byteLength || data.length)
    const view = new Uint8Array(data)
    for(var i in view) {

      // byte, i in view
      buffer[i] = view[i]
    }
    return buffer
  }

}
<commit_msg>Fix ArrayUtil.fromHex<commit_after>module.exports = class ArrayUtil {

  // Generates array from given hex string
  static fromHex(hex) {
    const array = []
    for(var i = 0; i < hex.length; i += 2) {
      array.push(parseInt(hex.slice(i, i + 2), 16))
    }
    return array
  }

  // Converts given data to buffer
  static toBuffer(data) {
    const buffer = new Buffer(data.byteLength || data.length)
    const view = new Uint8Array(data)
    for(var i in view) {

      // byte, i in view
      buffer[i] = view[i]
    }
    return buffer
  }

}

{'fraction_non_alphanumeric': 0.12180052956751986, 'fraction_numerical': 0.01059135039717564, 'mean_word_length': 2.395209580838323, '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': '6428151', 'n_tokens_mistral': 395, 'n_tokens_neox': 380, 'n_words': 111}