ruby-changes:22781
From: knu <ko1@a...>
Date: Mon, 27 Feb 2012 17:07:34 +0900 (JST)
Subject: [ruby-changes:22781] knu:r34830 (trunk): * string.c (rb_str_crypt): Update rdoc and state that this
knu 2012-02-27 17:07:24 +0900 (Mon, 27 Feb 2012) New Revision: 34830 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34830 Log: * string.c (rb_str_crypt): Update rdoc and state that this function is system dependent. Reviewed by nobu, thanks to @takai. Modified files: trunk/ChangeLog trunk/string.c Index: ChangeLog =================================================================== --- ChangeLog (revision 34829) +++ ChangeLog (revision 34830) @@ -1,3 +1,9 @@ +Mon Feb 27 17:00:15 2012 Akinori MUSHA <knu@i...> + + * string.c (rb_str_crypt): Update rdoc and state that this + function is system dependent. Reviewed by nobu, thanks to + @takai. + Mon Feb 27 17:03:20 2012 Nobuyoshi Nakada <nobu@r...> * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods Index: string.c =================================================================== --- string.c (revision 34829) +++ string.c (revision 34830) @@ -6771,12 +6771,19 @@ /* * call-seq: - * str.crypt(other_str) -> new_str + * str.crypt(salt_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>. + * 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/