File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ func (h Hash) MarshalText() ([]byte, error) {
8888 return hexutil .Bytes (h [:]).MarshalText ()
8989}
9090
91- // Sets the hash to the value of b. If b is larger than len(h) it will panic
91+ // Sets the hash to the value of b. If b is larger than len(h), 'b' will be cropped (from the left).
9292func (h * Hash ) SetBytes (b []byte ) {
9393 if len (b ) > len (h ) {
9494 b = b [len (b )- HashLength :]
@@ -97,7 +97,7 @@ func (h *Hash) SetBytes(b []byte) {
9797 copy (h [HashLength - len (b ):], b )
9898}
9999
100- // Set string `s` to h. If s is larger than len(h) it will panic
100+ // Set string `s` to h. If s is larger than len(h) s will be cropped (from left) to fit.
101101func (h * Hash ) SetString (s string ) { h .SetBytes ([]byte (s )) }
102102
103103// Sets h to other
You can’t perform that action at this time.
0 commit comments