Meteor the module for user password encryption is under Accounts-password:
https://github.com/meteor/meteor/blob/5931bcdae362e1026ceb8a08e5a4b053ce5340b7/packages/accounts-password/ Password_server.js
Through analysis, meteor encrypt the user password, first SHA256 the password to calculate, and then Bcrypt encryption. The resulting string is written to the users table Services.password.bcrypt.
Knowing that the algorithm above is easy to write consistent code through PHP.
Bcrypt encryption extension document in PHP in http://cn2.php.net/manual/zh/book.password.php
Final code:
Public Function Password_hash ($password) { return Password_hash (hash (' sha256 ', $password), Password_bcrypt, [' Salt ' =>mcrypt_create_iv (mcrypt_dev_urandom)]); }
Public Function Password_compare ($inputpassword, $hash) { return password_verify (hash (' sha256 ', $inputpassword), $hash); }
The above describes the Meteor User login Registration password verification PHP version, including the content, I hope to be interested in PHP tutorial friends helpful.