Created
August 17, 2015 04:46
-
-
Save cdurth/6735c82cd11c5a057bd4 to your computer and use it in GitHub Desktop.
simple parse to sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var csv = require("fast-csv"); | |
var sha1 = require('sha1'); | |
var inputFile = 'emailList.csv'; | |
var outputFile = 'sha1List.csv'; | |
var csvStream = csv.format({headers: false}), | |
writableStream = fs.createWriteStream(outputFile); | |
csvStream.pipe(writableStream); | |
csv | |
.fromPath(inputFile) | |
.on("data", function(data){ | |
var hashed = sha1(data[0]) | |
csvStream.write([hashed]); | |
}) | |
.on("end", function(){ | |
csvStream.end(); | |
console.log("done"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment