cache read performance improvements
This commit is contained in:
parent
39c4720e40
commit
f69d3149f3
14 changed files with 140 additions and 71 deletions
|
|
@ -3,6 +3,7 @@ package crypto
|
|||
import (
|
||||
"cachefs/pkg/provider"
|
||||
"crypto/rand"
|
||||
"encoding/binary"
|
||||
"io"
|
||||
"math"
|
||||
)
|
||||
|
|
@ -29,7 +30,6 @@ func initNonce(f provider.File) (nonce []byte, err error) {
|
|||
return
|
||||
}
|
||||
_, err = f.Write(nonce)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
@ -76,3 +76,7 @@ func inc(nonce *[NonceSize]byte, n int64) {
|
|||
incNonce(nonce)
|
||||
}
|
||||
}
|
||||
|
||||
func put(nonce *[NonceSize]byte, n int64) {
|
||||
binary.BigEndian.PutUint64((*nonce)[3:11], uint64(n))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue