To keep the changes from the commit you want to undo
$ git reset --soft HEAD^
To destroy the changes from the commit you want to undo
$ git reset --hard HEAD^
You can also say
To keep the changes from the commit you want to undo
$ git reset --soft HEAD^
To destroy the changes from the commit you want to undo
$ git reset --hard HEAD^
You can also say
| //how to execute: node verify.js <path file that you want to verify> <certificate path> <hash generate by sign.js> | |
| //output: true if files are equal, false otherwise. | |
| var crypto = require('crypto'); | |
| var fs = require('fs'); | |
| var args = process.argv.slice(2); | |
| var fileName = args[0]; | |
| var certPath = args[1]; | |
| var sig = args[2]; |
| //how to execute: node sign.js <path file> <path private key> | |
| //output: signature of file | |
| var crypto = require('crypto'); | |
| var fs = require('fs'); | |
| var args = process.argv.slice(2); | |
| var fileName = args[0]; | |
| var keyPath = args[1]; | |
| //openssl genrsa -out key.pem 1024 |
| var fs = require('fs'); | |
| var crypto = require('crypto'); | |
| fs.readFile('file.pdf', function(err, data) { | |
| var checksum = generateChecksum(data); | |
| console.log(checksum); | |
| }); | |
| function generateChecksum(str, algorithm, encoding) { | |
| return crypto |