aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/bytes.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil/bytes.go')
-rw-r--r--ethutil/bytes.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go
index 957fa254a..500368017 100644
--- a/ethutil/bytes.go
+++ b/ethutil/bytes.go
@@ -73,3 +73,13 @@ func BinaryLength(num int) int {
return 1 + BinaryLength(num>>8)
}
+
+// Copy bytes
+//
+// Returns an exact copy of the provided bytes
+func CopyBytes(b []byte) (copiedBytes []byte) {
+ copiedBytes = make([]byte, len(b))
+ copy(copiedBytes, b)
+
+ return
+}