https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-02-24T00:13:42ZRuby Issue Tracking SystemRuby master - Bug #6068: String::Hash documentation clarificationhttps://bugs.ruby-lang.org/issues/6068?journal_id=240662012-02-24T00:13:42Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul></ul><p>I'm not sure that all implementations have to return hash codes that differ from one run to the other. I would also modify <code>Object#hash</code>, as all hashes in CRuby are random seeded, not just String. I'd recommend adding the following line to Object#hash:</p>
<p>No other assumption can be made on hash values; in particular they may vary between sessions or implementations.</p> Ruby master - Bug #6068: String::Hash documentation clarificationhttps://bugs.ruby-lang.org/issues/6068?journal_id=240682012-02-24T07:24:00Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r34769.<br>
Daniel, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>object.c (rb_obj_hash): Added note that the hash value is not<br>
deterministic on Marc-Andre's suggestion. Expanded description of<br>
the purpose of the hash method. [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: String::Hash documentation clarification (Closed)" href="https://bugs.ruby-lang.org/issues/6068">#6068</a>]</li>
</ul> Ruby master - Bug #6068: String::Hash documentation clarificationhttps://bugs.ruby-lang.org/issues/6068?journal_id=240692012-02-24T07:39:14Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul></ul><p>Daniel, I couldn't use your patch as it was not line-wrapped to 80 columns and was too-specific to String. As Marc-Andre pointed out, the randomization behavior applies to Fixnum, Hash, String, Symbol, Array, etc., so I applied a patch based on his suggestion.</p>