Skip to content

Instantly share code, notes, and snippets.

@MarkPochert
Created September 30, 2011 21:00
Show Gist options
  • Select an option

  • Save MarkPochert/1254962 to your computer and use it in GitHub Desktop.

Select an option

Save MarkPochert/1254962 to your computer and use it in GitHub Desktop.
fs = require 'fs'
crypto = require 'crypto'
filenames = ['file.png','file.txt','server.coffee','server.js']
md5 = crypto.createHash('md5');
for value in filenames
s = fs.ReadStream(value)
on_data = (d) ->
md5.update(d)
on_end = () ->
console.log(md5.digest('hex') + ' ' + value)
s.on('data',on_data)
s.on('end',on_end)
8490ea9d5536609099320b72c1cc4d0b server.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment