mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[DOC] Tweaks for String#sum
This commit is contained in:
parent
e5e32acc7e
commit
bf2663ce06
Notes:
git
2025-10-28 01:15:21 +00:00
@ -1,4 +1,4 @@
|
||||
Returns a basic +n+-bit checksum of the characters in +self+;
|
||||
Returns a basic +n+-bit {checksum}[https://en.wikipedia.org/wiki/Checksum] of the characters in +self+;
|
||||
the checksum is the sum of the binary value of each byte in +self+,
|
||||
modulo <tt>2**n - 1</tt>:
|
||||
|
||||
@ -9,3 +9,5 @@ modulo <tt>2**n - 1</tt>:
|
||||
'こんにちは'.sum # => 2582
|
||||
|
||||
This is not a particularly strong checksum.
|
||||
|
||||
Related: see {Querying}[rdoc-ref:String@Querying].
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user