Method crypt()
- Method
crypt
string(46..122)crypt(string(1..255)password)
boolcrypt(string(1..255)input_password,string(46..122)crypted_password)
string(46..122)crypt()- Description
This function crypts and verifies a short string (only the first 8 characters are significant).
The first syntax crypts the string
passwordinto something that is hopefully hard to decrypt.The second syntax is used to verify
typed_passwordagainstcrypted_password, and returns1if they match, and0(zero) otherwise.The third syntax generates a random string and then crypts it, creating a string useful as a password.
- Note
Note that strings containing null characters will only be processed up until the null character.