crypt

  • PHP’s crypt function returns an encrypted string using a standard Unix DES-based encryption or an alternate based on the system. This operation has very similar usage in PHP and Ruby. Ruby uses the String#crypt method with a single salt parameter to get the same result.

    PHP

    print crypt("my string", "salt");
    // => saGMxKJ.nmUhU

    Ruby

    print "my string".crypt("salt")
    # => saGMxKJ.nmUhU

    see also

Looking for Rails or PHP web application development, integration, and training?

Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.