diff --git a/index.js b/index.js index cc32fa9..bf03e68 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,8 @@ -/* sòm - * Compute checksum of a file. - * - * started at 25/09/2015 - */ +/* Homework +* Compute checksum of a file. +* +* started at 1/10/15 +*/ "use strict"; @@ -10,12 +10,12 @@ var chalk = require( "chalk" ), path = require( "path" ), fs = require( "fs" ), humanSize = require( "human-size" ), - crc32 = require( "easy-crc32" ).calculate; + md5 = require( "md5" ); var sFileName, sFilePath; -var fShowError = function( sErrorMessage ) { - console.log( chalk.red.bold.underline( "✘ error:" ), sErrorMessage ); +var fShowError = function( sErrorMessage ) { + console.log( chalk.red.bold.underline( "x error:" ), sErrorMessage ); process.exit( 1 ); }; @@ -48,7 +48,7 @@ fs.stat( sFilePath, function( oError, oStats ) { fShowError( oError ); } - aLogLines.push( chalk.green.bold( "sum:" ) + " " + crc32( sData ) ); + aLogLines.push( chalk.green.bold( "sum:" ) + " " + md5( sData ) ); console.log( aLogLines.join( " " ) ); } ); diff --git a/package.json b/package.json index 9869c0a..2d06b54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "som", - "version": "0.0.1", + "version": "0.1.1", "private": true, "description": "Compute checksum of a file.", "keywords": [ @@ -9,8 +9,8 @@ "checksum" ], "author": { - "name": "leny", - "email": "info@flatland.be" + "name": "aure", + "email": "aurelie.mairesse@student.hepl.be" }, "homepage": "https://github.com/hepl-ria/som#readme", "repository": { @@ -24,7 +24,7 @@ "main": "index.js", "dependencies": { "chalk": "^1.1.1", - "easy-crc32": "0.0.2", + "md5": "^2.0.0", "human-size": "^1.1.0" } }