Reuse buffers for stream cipher

This commit is contained in:
9seconds
2018-07-20 14:49:22 +03:00
parent c8da08ecce
commit 0d0bdd9fde
2 changed files with 27 additions and 3 deletions
+16
View File
@@ -0,0 +1,16 @@
package wrappers
import (
"bytes"
"sync"
)
var streamCipherBufferPool sync.Pool
func init() {
streamCipherBufferPool = sync.Pool{
New: func() interface{} {
return &bytes.Buffer{}
},
}
}