mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-20 23:32:19 +00:00
feat(security): prefer digest identity in scan history (#1610)
Retain scans and History search by digest when available, keep imageRefLike for compatibility, and surface digests in compare.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Shorten a Docker content digest or image ID for display.
|
||||
* Accepts `sha256:…` or bare hex; returns up to 12 hex characters.
|
||||
*/
|
||||
export function formatShortDigest(id: string | null | undefined): string {
|
||||
if (!id) return '';
|
||||
const colon = id.indexOf(':');
|
||||
const hex = colon >= 0 ? id.slice(colon + 1) : id;
|
||||
return hex.slice(0, 12);
|
||||
}
|
||||
Reference in New Issue
Block a user