How to generate password salt with codeigniter

// Hash a new password for storing in the database.
// The function automatically generates a cryptographically safe salt.
$hashToStoreInDb = password_hash($password, PASSWORD_BCRYPT);

// Check if the hash of the entered login password, matches the stored hash.
// The salt and the cost factor will be extracted from $existingHashFromDb.
$isPasswordCorrect = password_verify($password, $existingHashFromDb);

Refrence:

https://stackoverflow.com/questions/25720721/how-to-generate-password-salt-with-codeigniter

Comments

Popular posts from this blog

dynamic create multiple ckeditor onclick event using jquery

Fatal error: Can't use method return value in write context in ci

online visitor counter