[DOC] Tweaks for String#sum

This commit is contained in:
BurdetteLamar 2025-10-26 21:35:07 +01:00 committed by Peter Zhu
parent e5e32acc7e
commit bf2663ce06
Notes: git 2025-10-28 01:15:21 +00:00

View File

@ -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].