Commit 8743cc1c authored by Felix Lange's avatar Felix Lange Committed by Jeffrey Wilcke

rlp: add ListSize

parent a0566c10
...@@ -29,6 +29,12 @@ type Encoder interface { ...@@ -29,6 +29,12 @@ type Encoder interface {
EncodeRLP(io.Writer) error EncodeRLP(io.Writer) error
} }
// ListSize returns the encoded size of an RLP list with the given
// content size.
func ListSize(contentSize uint64) uint64 {
return uint64(headsize(contentSize)) + contentSize
}
// Encode writes the RLP encoding of val to w. Note that Encode may // Encode writes the RLP encoding of val to w. Note that Encode may
// perform many small writes in some cases. Consider making w // perform many small writes in some cases. Consider making w
// buffered. // buffered.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment