nl_tokens: This runs in just under 1 second and ensures a minimum of cpuEntropyBits bits of entropy are gathered .
pl_tokens: function cpuEntropy ( cpuEntropyBits = 128 ) { let collected = [ ] ; let lastCount = null ; let lowEntropySamples = 0 ; while ( collected . length < cpuEntropyBits ) { const <mask> = floatingPointCount ( ) ; if ( lastCount != null ) { const delta = count - lastCount ; if ( Math . abs ( delta ) < 1 ) { lowEntropySamples ++ ; continue ; } // how many bits of entropy were in this sample const bits = Math . floor ( log2 ( Math . abs ( delta ) ) + 1 ) ; if ( bits < 4 ) { if ( bits < 2 ) { lowEntropySamples ++ ; } continue ; } collected . push ( delta ) ; } lastCount = count ; } if ( lowEntropySamples > 10 ) { const pct = Number ( lowEntropySamples / cpuEntropyBits * 100 ) . toFixed ( 2 ) ; // Is this algorithm getting inefficient? console . warn ( ` ${ pct } ` ) ; } return collected ; }