For a login application, how would i go about checking the sha1 value of a password?

后端 未结 1 1665
伪装坚强ぢ
伪装坚强ぢ 2021-01-29 08:15

How would i go about adding a function that checks the db for the users sha1 password value?

  

        
相关标签:
1条回答
  • 2021-01-29 08:43

    In PHP there is a sha1() function already. So it's as simple as calling this function:
    if (sha1($userInput) == $yourStoredPassword) // The password is correct
    But remember that sha1 without any salt is not a very secure hashing solution.

    0 讨论(0)
提交回复
热议问题