Skip to content

Instantly share code, notes, and snippets.

@pkyeck
Created February 17, 2014 10:12
Show Gist options
  • Select an option

  • Save pkyeck/9048021 to your computer and use it in GitHub Desktop.

Select an option

Save pkyeck/9048021 to your computer and use it in GitHub Desktop.

Revisions

  1. pkyeck created this gist Feb 17, 2014.
    9 changes: 9 additions & 0 deletions sha256.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    var crypto = require("crypto");

    var hash1 = crypto.createHash("sha256");
    hash1.update("topsecret", "utf8");
    console.log(hash1.digest("base64")); // UzNqZ2xkwTllU7K3yS84EmdognyTtk2RQgacEO2npyE=

    var hash2 = crypto.createHash("sha256");
    hash2.update("topSecret", "utf8");
    console.log(hash2.digest("base64")); // mFuUzsUvYbRLt21+34+fwP6IpapAhqBLsbycLnGfQIc=