mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
rlp: add IntSize
This commit is contained in:
parent
2a3322ea14
commit
f12a3249af
1 changed files with 7 additions and 0 deletions
|
|
@ -34,6 +34,13 @@ func ListSize(contentSize uint64) uint64 {
|
||||||
return uint64(headsize(contentSize)) + contentSize
|
return uint64(headsize(contentSize)) + contentSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IntSize(i uint64) uint64 {
|
||||||
|
if i < 128 {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 1 + uint64(intsize(i))
|
||||||
|
}
|
||||||
|
|
||||||
// Split returns the content of first RLP value and any
|
// Split returns the content of first RLP value and any
|
||||||
// bytes after the value as subslices of b.
|
// bytes after the value as subslices of b.
|
||||||
func Split(b []byte) (k Kind, content, rest []byte, err error) {
|
func Split(b []byte) (k Kind, content, rest []byte, err error) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue