refactor: rename encode method

This commit is contained in:
Derrick Hammer 2023-05-06 04:38:09 -04:00
parent 5ba0111d08
commit 2dc9d4dcf6
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import (
"github.com/multiformats/go-multibase"
)
func EncodeHashSimple(hash [32]byte, size uint64) (string, error) {
func Encode(hash [32]byte, size uint64) (string, error) {
sizeBytes := make([]byte, 8)
binary.LittleEndian.PutUint64(sizeBytes, size)

View File

@ -52,7 +52,7 @@ func (f *FilesService) PostUpload() {
hashBytes := blake3.Sum256(buf)
hashHex := hex.EncodeToString(hashBytes[:])
fileCid, err := cid.EncodeHashSimple(hashBytes, uint64(meta.Size))
fileCid, err := cid.Encode(hashBytes, uint64(meta.Size))
if internalError(ctx, err) {
return