from_file.js 330 B

123456789
  1. var XXH = require('..')
  2. var buf = require('fs').readFileSync( process.argv[2] )
  3. // var buf = buf.toString()
  4. console.log('data loaded:', buf.length, 'bytes')
  5. var startTime = Date.now()
  6. var h = XXH.h32(0).update(buf).digest()
  7. var delta = Date.now() - startTime
  8. console.log( '0x' + h.toString(16).toUpperCase(), 'in', delta, 'ms' )