extend.js 302 B

12345678910111213141516171819202122
  1. module.exports = function(PT){
  2. console.log("HEREHER");
  3. var crypto = require("crypto");
  4. PT.SHA256 = function(encoding){
  5. var encoding = encoding || null;
  6. var h=crypto.createHash('sha256');
  7. console.log(new Buffer(this));
  8. h.update(new Buffer(this));
  9. return h.digest(encoding);
  10. }
  11. }