Socket
Socket
Sign inDemoInstall

bcryptjs

Package Overview
Dependencies
0
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.12 to 1.0.0

dist/bcrypt.js

12

externs/minimal-env.js

@@ -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) {};

11

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc