Pad artifact IDs (#1882)

Otherwise the hash can sometimes be short if it results in a low uint64.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
William Murphy 2023-06-16 13:26:18 -04:00 committed by GitHub
parent badb957888
commit e2ed89f700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -22,5 +22,5 @@ func IDByHash(obj interface{}) (ID, error) {
return "", fmt.Errorf("could not build ID for object=%+v: %w", obj, err)
}
return ID(fmt.Sprintf("%x", f)), nil
return ID(fmt.Sprintf("%016x", f)), nil
}

View file

@ -91,7 +91,7 @@
}
},
{
"id": "e7c88bd18e11b0b",
"id": "0e7c88bd18e11b0b",
"location": {
"path": "/a/place/a"
},