php - How to compare two encrypted(bcrypt) password in laravel -


how compare 2 bcrypt password

$pass1 = '$2y$10$oopg9s1lcwugyv1nqeynco0ccyjf8hlhm5djxy7xoamvgiczxhb7s'; 

and

$pass2 = '$2y$10$qrgais6bpatkkqet22zgkuhq.eddfxqc2.4b3v.zan.gtgwoyqumy'; 

both $pass1 & $pass2 bcrypt 'test'.

how can check equality. without using text 'test' this

$hash1 = hash::make('test'); $hash2 = hash::make('test');  var_dump(hash::check('test', $hash1) && hash::check('test', $hash2)); 

you can't compare 2 encrypted bcrypt passwords each other directly strings because encryption contains salt makes hashes different each time.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -