Skip to content

Instantly share code, notes, and snippets.

@knu
Created February 27, 2012 07:34
Show Gist options
  • Save knu/1922282 to your computer and use it in GitHub Desktop.
Save knu/1922282 to your computer and use it in GitHub Desktop.
rdoc for String#crypt
/*
* call-seq:
* str.crypt(salt_str) -> new_str
*
* Applies a one-way cryptographic hash to <i>str</i> by invoking the
* standard library function <code>crypt(3)</code> with the given
* salt string. While the format and the results are
* system/implementation dependent, using a salt matching the regular
* expression <code>\A[a-zA-Z0-9./]{2}</code> should be safe and valid
* on any platform, in which only the first two characters are
* significant.
*
* This method is for use in system specific scripts, so if you want
* a cross-platform hash function consider using Digest or OpenSSL
* instead.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment