<commit_before>module.exports = function( Gibber ) {

let Pattern = Gibber.Pattern

let Hex = function( hexString, time = 1/16, rotation ) {
  let count = 0,
      onesAndZeros = ''

  if( typeof hexString === 'string' ) {
    for( let chr of hexString ) {
      let num = Number( '0x'+chr )

      onesAndZeros += (num & 8) > 0 ? 1 : 0
      onesAndZeros += (num & 4) > 0 ? 1 : 0
      onesAndZeros += (num & 2) > 0 ? 1 : 0
      onesAndZeros += (num & 1) > 0 ? 1 : 0
    }
  }else{
    onesAndZeros = hexString.toString(2)
    while( onesAndZeros.length < 16 ) {
      onesAndZeros = '0'+onesAndZeros
    }
  }

  let __onesAndZeros = onesAndZeros.split('') 

  let pattern = Pattern( ...__onesAndZeros ) 
  pattern.isPattern = true
  pattern.type = 'Hex'

  pattern.time = time

  pattern.output = { time, shouldExecute: 0 }
  
  pattern.addFilter( ( args, ptrn ) => {
    let val = args[ 0 ]

    ptrn.output.time = Gibberish.Clock.time( ptrn.time )
    ptrn.output.shouldExecute = parseInt(val) 

    args[ 0 ] = ptrn.output 

    return args
  })

  pattern.reseed = ( ...args )=> {
    let n, k
    
    if( Array.isArray( args[0] ) ) {
      k = args[0][0]
      n = args[0][1]
    }else{
      k = args[0]
      n = args[1]
    }

    if( n === undefined ) n = 16
    <commit_msg>changing some lets to consts<commit_after>module.exports = function( Gibber ) {

const Pattern = Gibber.Pattern

const Hex = function( hexString, time = 1/16, rotation ) {
  let count = 0,
      onesAndZeros = ''

  if( typeof hexString === 'string' ) {
    for( let chr of hexString ) {
      let num = Number( '0x'+chr )

      onesAndZeros += (num & 8) > 0 ? 1 : 0
      onesAndZeros += (num & 4) > 0 ? 1 : 0
      onesAndZeros += (num & 2) > 0 ? 1 : 0
      onesAndZeros += (num & 1) > 0 ? 1 : 0
    }
  }else{
    onesAndZeros = hexString.toString(2)
    while( onesAndZeros.length < 16 ) {
      onesAndZeros = '0'+onesAndZeros
    }
  }

  let __onesAndZeros = onesAndZeros.split('') 

  const pattern = Pattern( ...__onesAndZeros ) 
  pattern.isPattern = true
  pattern.type = 'Hex'

  pattern.time = time

  pattern.output = { time, shouldExecute: 0 }
  
  pattern.addFilter( ( args, ptrn ) => {
    let val = args[ 0 ]

    ptrn.output.time = Gibberish.Clock.time( ptrn.time )
    ptrn.output.shouldExecute = parseInt(val) 

    args[ 0 ] = ptrn.output 

    return args
  })

  pattern.reseed = ( ...args )=> {
    let n, k
    
    if( Array.isArray( args[0] ) ) {
      k = args[0][0]
      n = args[0][1]
    }else{
      k = args[0]
      n = args[1]
    }

    if( n === undefined ) n = 16
    
{'fraction_non_alphanumeric': 0.1462100808003078, 'fraction_numerical': 0.02847248941900731, 'mean_word_length': 2.166869671132765, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '1611657', 'n_tokens_mistral': 1026, 'n_tokens_neox': 945, 'n_words': 240}