aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/raw.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-09-10 20:48:19 +0800
committerFelix Lange <fjl@twurst.com>2015-09-11 01:41:51 +0800
commitfc8b246109760714a838f4be163cca1dbb998163 (patch)
tree764dab3a03b47ff2d2bcdd788b629a4284e6ad2d /rlp/raw.go
parent24bb68e7cf546153436f1d38a7227fdf75d73343 (diff)
downloaddexon-fc8b246109760714a838f4be163cca1dbb998163.tar.gz
dexon-fc8b246109760714a838f4be163cca1dbb998163.tar.zst
dexon-fc8b246109760714a838f4be163cca1dbb998163.zip
rlp: move ListSize to raw.go
Diffstat (limited to 'rlp/raw.go')
-rw-r--r--rlp/raw.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/rlp/raw.go b/rlp/raw.go
index fca445618..33aae6ee5 100644
--- a/rlp/raw.go
+++ b/rlp/raw.go
@@ -28,6 +28,12 @@ type RawValue []byte
var rawValueType = reflect.TypeOf(RawValue{})
+// ListSize returns the encoded size of an RLP list with the given
+// content size.
+func ListSize(contentSize uint64) uint64 {
+ return uint64(headsize(contentSize)) + contentSize
+}
+
// Split returns the content of first RLP value and any
// bytes after the value as subslices of b.
func Split(b []byte) (k Kind, content, rest []byte, err error) {