Skip to content

Commit 565bee8

Browse files
committed
Use static path in index.js for browserify, fixes #8
1 parent 40e7a16 commit 565bee8

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,5 @@
2525
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2626
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
*/
28-
var path = require("path"),
29-
bcrypt = require(path.join(__dirname, "dist", "bcrypt.js"));
3028

31-
module.exports = bcrypt;
29+
module.exports = require("./dist/bcrypt.js");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bcryptjs",
33
"description": "Optimized bcrypt in plain JavaScript with zero dependencies. Compatible to 'bcrypt'.",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"author": "Daniel Wirtz <dcode@dcode.io>",
66
"contributors": [
77
"Shane Girish <shaneGirish@gmail.com> (https://github.com/shaneGirish)",

tests/suite.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ module.exports = {
3939
},
4040

4141
"compareSync": function(test) {
42-
var hash1 = bcrypt.hashSync("hello", bcrypt.genSaltSync());
43-
var hash2 = bcrypt.hashSync("world", bcrypt.genSaltSync());
42+
var salt1 = bcrypt.genSaltSync(),
43+
hash1 = bcrypt.hashSync("hello", salt1); // $2a$
44+
var salt2 = bcrypt.genSaltSync();
45+
salt2 = salt2.substring(0,2)+'y'+salt2.substring(3); // $2y$
46+
var hash2 = bcrypt.hashSync("world", salt2);
4447
test.ok(bcrypt.compareSync("hello", hash1));
4548
test.notOk(bcrypt.compareSync("hello", hash2));
4649
test.ok(bcrypt.compareSync("world", hash2));

0 commit comments

Comments
 (0)