It looks like the original error comes from the fact that under v0.10 hash is both a readable stream and a writable one at the same time. You probably assumed setEncoding() would set the output (i.e. the hash) encoding, but it looks like here it is interpreted as the input encoding, and should be given one of 'utf8', 'ascii' or 'binary'. I'd suggest using hash.digest('hex') instead of setEncoding & read calls.