Commit Graph

7 Commits

Author SHA1 Message Date
Martin Holst Swende
175506e7fd
core/types, rlp: optimize derivesha (#21728)
This PR contains a minor optimization in derivesha, by exposing the RLP
int-encoding and making use of it to write integers directly to a
buffer (an RLP integer is known to never require more than 9 bytes
total). rlp.AppendUint64 might be useful in other places too.

The code assumes, just as before, that the hasher (a trie) will copy the
key internally, which it does when doing keybytesToHex(key).

Co-authored-by: Felix Lange <fjl@twurst.com>
2020-11-04 19:29:24 +01:00
Felix Lange
f7112cc182
rlp: add SplitUint64 (#21563)
This can be useful when working with raw RLP data.
2020-09-14 19:23:01 +02:00
Felix Lange
2499b1b139
rlp: fix string size check in readKind (#15625)
Issue found by @guidovranken
2017-12-11 22:47:10 +01:00
S. Matthew English
061889d4ea rlp, trie, contracts, compression, consensus: improve comments (#14580) 2017-06-12 14:45:17 +02:00
Felix Lange
fc8b246109 rlp: move ListSize to raw.go 2015-09-10 19:41:51 +02:00
Felix Lange
24bb68e7cf rlp: add RawValue 2015-09-10 19:41:51 +02:00
Felix Lange
bc17dba8fb rlp: add Split functions
These functions allow destructuring of raw rlp-encoded bytes
without the overhead of reflection or copying.
2015-09-10 19:41:51 +02:00