File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ) ;
Original file line number Diff line number Diff line change 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)" ,
Original file line number Diff line number Diff 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 ) ) ;
You can’t perform that action at this time.
0 commit comments