From 2a5e2c7dbcf01d5e58ede37c58b674dda27c4ca0 Mon Sep 17 00:00:00 2001 From: Rafael Mestre <277805+rlmestre@users.noreply.github.com> Date: Tue, 5 Aug 2025 08:21:33 -0400 Subject: [PATCH] fix: use crypto global for web compatibility --- src/spdx-to-cdx.mts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/spdx-to-cdx.mts b/src/spdx-to-cdx.mts index 603023b..0c46b48 100644 --- a/src/spdx-to-cdx.mts +++ b/src/spdx-to-cdx.mts @@ -1,4 +1,3 @@ -import { randomUUID } from 'node:crypto'; import { Enums } from '@cyclonedx/cyclonedx-library'; import type * as CDX from '@cyclonedx/cyclonedx-library'; import type { SPDX23 } from './types/bom/spdx-2.3.schema.js'; @@ -70,7 +69,7 @@ export function spdxToCdxBom(spdx: SPDX23): CdxBom { $schema: 'http://cyclonedx.org/schema/bom-1.5.schema.json', bomFormat: 'CycloneDX', specVersion: '1.5', - serialNumber: `urn:uuid:${randomUUID()}`, + serialNumber: `urn:uuid:${crypto.randomUUID()}`, version: 1, metadata: { timestamp: spdx.creationInfo.created,