Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-06-16 11:37:08 +0400
committerisaacs <i@izs.me>2010-06-16 11:37:08 +0400
commite5ed4ed332225f0894d5e171ebddfa7a747920ac (patch)
tree457642fbf819b7f7fe7476ef5d8e4631873ffa6b
parent877306c56a4ae5f8da6e6dcb5b0c65c210ac7eca (diff)
update method of creating hash object
-rw-r--r--lib/link.js2
-rw-r--r--lib/utils/registry/adduser.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/link.js b/lib/link.js
index 5569ff0dd..0f702becf 100644
--- a/lib/link.js
+++ b/lib/link.js
@@ -34,7 +34,7 @@ function link (args, cb) {
, function (cb) { readJson
( jsonFile
, "-LINK-"+(
- new crypto.Hash().init("sha1").update(folder).digest("hex").substr(0,8)
+ crypto.createHash("sha1").update(folder).digest("hex").substr(0,8)
)
, function (er, data) {
if (er) return cb(er)
diff --git a/lib/utils/registry/adduser.js b/lib/utils/registry/adduser.js
index dca5a3b85..631bb49a2 100644
--- a/lib/utils/registry/adduser.js
+++ b/lib/utils/registry/adduser.js
@@ -7,7 +7,7 @@ var uuid = require("../uuid")
, log = require("../log")
function sha (s) {
- return new crypto.Hash().init("sha1").update(s).digest("hex")
+ return crypto.createHash("sha1").update(s).digest("hex")
}
function adduser (username, password, email, callback) {