Guest User

Untitled

a guest
Jun 18th, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. var crypto = require("crypto"),
  2. assert = require("assert");
  3.  
  4. assert.equal(
  5. 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
  6. crypto.createHash("sha256").update("").digest("hex"))
  7.  
  8. assert.equal(
  9. 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad',
  10. crypto.createHash("sha256").update("abc").digest("hex"))
  11.  
  12. assert.equal(
  13. 'f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650',
  14. crypto.createHash("sha256").update("message digest").digest("hex"))
  15.  
  16. assert.equal(
  17. 'f30ceb2bb2829e79e4ca9753d35a8ecc00262d164cc077080295381cbd643f0d',
  18. crypto.createHash("sha256").update("secure hash algorithm").digest("hex"))
  19.  
  20. assert.equal(
  21. '6819d915c73f4d1e77e4e1b52d1fa0f9cf9beaead3939f15874bd988e2a23630',
  22. crypto.createHash("sha256").update("SHA256 is considered to be safe").digest("hex"))
  23.  
  24. assert.equal(
  25. '248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1',
  26. crypto.createHash("sha256").update("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq").digest("hex"))
  27.  
  28. assert.equal(
  29. 'f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342',
  30. crypto.createHash("sha256").update("For this sample, this 63-byte string will be used as input data").digest("hex"))
  31.  
  32. assert.equal(
  33. 'ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8',
  34. crypto.createHash("sha256").update("This is exactly 64 bytes long, not counting the terminating byte").digest("hex"))
Add Comment
Please, Sign In to add comment