This particular function, which you copied from GitHub, is already given to you through the MTA functions. I gave you the link to the wiki and a little example function call how to do it, where did you get stuck? I mean, you only have to call the function hash with the first parameter being the algorithm as a string, in your case it should be "sha1", and the second parameter the to-be-hashed string. In your code you did sha1(password), replace it with hash("sha1", password). Work done and you don't have to include any third-party code to your resource.