Jump to content
Sign in to follow this  

[PR] Upgrade hash algo to use password_hash/password_verify

Recommended Posts

Posted (edited)

Just in case it gets seen here first before Github: https://github.com/ChristopherDay/Gangster-Legends-V2/pull/54

Added a backward compatible way to update the hash algo from `sha256` to use the preferred `password_hash`/`password_verify` methods.

- Introduced two new methods `hash_password($var)` and `verify_password($salt, $password, $compareTo = null)` and deprecated the old `encode` method
- Removed the user ID salt as `password_hash` handles salt generation

I've tested login and register with both passwords using the old algo and the new one but can't test forgot password locally, though, theoretically it should work as login and register do.

Edited by Script47
  • Like 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...