diff --git a/lib/sources/NPMRegistrySource.js b/lib/sources/NPMRegistrySource.js index b1647e8..41b90dc 100644 --- a/lib/sources/NPMRegistrySource.js +++ b/lib/sources/NPMRegistrySource.js @@ -171,6 +171,8 @@ NPMRegistrySource.prototype.toNixAST = function() { case "sha1": paramExpr.sha1 = this.sha1; break; + case "sha256": + paramExpr.sha256 = this.sha256; case "sha512": paramExpr.sha512 = this.sha512; break; diff --git a/lib/sources/Source.js b/lib/sources/Source.js index f20ded1..69a7391 100644 --- a/lib/sources/Source.js +++ b/lib/sources/Source.js @@ -108,6 +108,9 @@ Source.prototype.convertIntegrityStringToNixHash = function(integrity) { var hash = base64js.toByteArray(integrity.substring(5)); this.hashType = "sha1"; this.sha1 = new Buffer(hash).toString('hex'); + } else if(integrity.substr(0, 7) === "sha256-") { + this.hashType = "sha256"; + this.sha256 = integrity.substring(7); } else if(integrity.substr(0, 7) === "sha512-") { this.hashType = "sha512"; this.sha512 = integrity.substring(7);