aboutsummaryrefslogtreecommitdiffstats
path: root/services/packages/packages.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/packages/packages.go')
-rw-r--r--services/packages/packages.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/services/packages/packages.go b/services/packages/packages.go
index f819949c96..49f5a2fac4 100644
--- a/services/packages/packages.go
+++ b/services/packages/packages.go
@@ -5,6 +5,7 @@ package packages
import (
"context"
+ "encoding/hex"
"errors"
"fmt"
"io"
@@ -229,10 +230,10 @@ func NewPackageBlob(hsr packages_module.HashedSizeReader) *packages_model.Packag
return &packages_model.PackageBlob{
Size: hsr.Size(),
- HashMD5: fmt.Sprintf("%x", hashMD5),
- HashSHA1: fmt.Sprintf("%x", hashSHA1),
- HashSHA256: fmt.Sprintf("%x", hashSHA256),
- HashSHA512: fmt.Sprintf("%x", hashSHA512),
+ HashMD5: hex.EncodeToString(hashMD5),
+ HashSHA1: hex.EncodeToString(hashSHA1),
+ HashSHA256: hex.EncodeToString(hashSHA256),
+ HashSHA512: hex.EncodeToString(hashSHA512),
}
}