Skip to content

Instantly share code, notes, and snippets.

View takai's full-sized avatar

Naoto Takai takai

View GitHub Profile
@knu
knu / gist:1922282
Created February 27, 2012 07:34
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