bcryptjs
Advanced tools
Comparing version 0.7.12 to 1.0.0
@@ -87,1 +87,13 @@ /** | ||
define.amd; | ||
/** | ||
* @param {...*} var_args | ||
* @returns {string} | ||
*/ | ||
String.fromCodePoint = function(var_args) {}; | ||
/** | ||
* @param {number} offset | ||
* @returns {number} | ||
*/ | ||
String.prototype.codePointAt = function(offset) {}; |
{ | ||
"name": "bcryptjs", | ||
"description": "Optimized bcrypt in plain JavaScript with zero dependencies. 100% typed code. Fully compatible to 'bcrypt'.", | ||
"version": "0.7.12", | ||
"version": "1.0.0", | ||
"author": "Daniel Wirtz <dcode@dcode.io>", | ||
@@ -29,3 +29,3 @@ "contributors": [ | ||
], | ||
"main": "./bcrypt.min.js", | ||
"main": "index.js", | ||
"dependencies": {}, | ||
@@ -35,3 +35,4 @@ "devDependencies": { | ||
"preprocessor": "latest", | ||
"closurecompiler": "latest" | ||
"closurecompiler": "latest", | ||
"bcrypt": "latest" | ||
}, | ||
@@ -41,6 +42,6 @@ "license": "Apache-2.0", | ||
"test": "node node_modules/testjs/bin/testjs", | ||
"build": "preprocess ./src/bcrypt.js ./src > ./bcrypt.js", | ||
"compile": "ccjs bcrypt.js --warning_level=VERBOSE --compilation_level=ADVANCED_OPTIMIZATIONS --externs=externs/minimal-env.js > bcrypt.min.js", | ||
"build": "preprocess ./src/bcrypt.js ./src > ./dist/bcrypt.js", | ||
"compile": "ccjs dist/bcrypt.js --warning_level=VERBOSE --compilation_level=ADVANCED_OPTIMIZATIONS --externs=externs/minimal-env.js > dist/bcrypt.min.js", | ||
"make": "npm run-script build && npm run-script compile && npm test" | ||
} | ||
} |
@@ -210,2 +210,3 @@ ![bcrypt.js - bcrypt in plain JavaScript](https://raw.github.com/dcodeIO/bcrypt.js/master/bcrypt.png) | ||
--------- | ||
* [Distributions](https://github.com/dcodeIO/bcrypt.js/tree/master/dist) | ||
* [ZIP-Archive](https://github.com/dcodeIO/bcrypt.js/archive/master.zip) | ||
@@ -212,0 +213,0 @@ * [Tarball](https://github.com/dcodeIO/bcrypt.js/tarball/master) |
@@ -36,4 +36,6 @@ /* | ||
// #include "base64.js" | ||
// #include "base64/native.js" | ||
// #include "utf8/native.js" | ||
/** | ||
@@ -538,14 +540,13 @@ * bcrypt namespace. | ||
function _stringToBytes ( str ) { | ||
var ch, st, re = []; | ||
for (var i = 0; i < str.length; i++ ) { | ||
ch = str.charCodeAt(i); | ||
st = []; | ||
do { | ||
st.push( ch & 0xFF ); | ||
ch = ch >> 8; | ||
} while (ch); | ||
re = re.concat( st.reverse() ); | ||
function _stringToBytes(str) { | ||
var cp, out = []; | ||
for (var i=0; i<str.length; i++) { | ||
cp = str.charCodeAt(i); | ||
if (cp >= 0xD800 && cp <= 0xDFFF) { | ||
cp = str.codePointAt(i); | ||
if (cp > 0xFFFF) i++; | ||
} | ||
utf8_encode_char(cp, out); | ||
} | ||
return re; | ||
return out; | ||
} | ||
@@ -592,3 +593,3 @@ | ||
var saltb = []; | ||
saltb = base64.decode(real_salt, BCRYPT_SALT_LEN); | ||
saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); | ||
@@ -609,4 +610,4 @@ /** | ||
res.push("$"); | ||
res.push(base64.encode(saltb, saltb.length)); | ||
res.push(base64.encode(bytes, C_ORIG.length * 4 - 1)); | ||
res.push(base64_encode(saltb, saltb.length)); | ||
res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); | ||
return res.join(''); | ||
@@ -676,3 +677,3 @@ } | ||
try { | ||
salt.push(base64.encode(_randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); | ||
salt.push(base64_encode(_randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); | ||
return salt.join(''); | ||
@@ -679,0 +680,0 @@ } catch(err) { |
var path = require("path"), | ||
bcrypt = require(path.join(__dirname, '..', 'bcrypt.js')); | ||
fs = require("fs"), | ||
binding = require("bcrypt"), | ||
bcrypt = require(path.join(__dirname, '..', 'index.js')); | ||
@@ -85,3 +87,12 @@ module.exports = { | ||
test.done(); | ||
}, | ||
"compat": function(test) { | ||
var pass = fs.readFileSync(path.join(__dirname, "quickbrown.txt"))+"", | ||
salt = bcrypt.genSaltSync(), | ||
hash1 = binding.hashSync(pass, salt), | ||
hash2 = bcrypt.hashSync(pass, salt); | ||
test.equal(hash1, hash2); | ||
test.done(); | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
143267
18
2452
2
222
4
3
1