Fixed state problem

This commit is contained in:
obscuren
2014-04-29 12:36:27 +02:00
parent 5516efdfa0
commit 38d6b67b5c
7 changed files with 48 additions and 20 deletions

View File

@@ -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
}