diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-27 08:07:24 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-27 08:07:24 +0000 |
commit | 34205bc4ec63f693d2ebab1b1371b2119d7c4391 (patch) | |
tree | 603c8a1d833eaf9da46c24bd0dcada0bb3161196 /string.c | |
parent | f5482e4c38732db8912a68652735f8ddac020141 (diff) | |
download | ruby-34205bc4ec63f693d2ebab1b1371b2119d7c4391.tar.gz |
* string.c (rb_str_crypt): Update rdoc and state that this
function is system dependent. Reviewed by nobu, thanks to
@takai.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -6771,12 +6771,19 @@ rb_str_oct(VALUE str) /* * call-seq: - * str.crypt(other_str) -> new_str - * - * Applies a one-way cryptographic hash to <i>str</i> by invoking the standard - * library function <code>crypt</code>. The argument is the salt string, which - * should be two characters long, each character drawn from - * <code>[a-zA-Z0-9./]</code>. + * 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 result are system and + * implementation dependent, using a salt matching the regular + * expression <code>^[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. */ static VALUE |