Skip to content

Commit 8d5529c

Browse files
authored
fix: use crypto global for web compatibility (#8)
1 parent 1e8326d commit 8d5529c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/spdx-to-cdx.mts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { randomUUID } from 'node:crypto';
21
import { Enums } from '@cyclonedx/cyclonedx-library';
32
import type * as CDX from '@cyclonedx/cyclonedx-library';
43
import type { SPDX23 } from './types/bom/spdx-2.3.schema.js';
@@ -70,7 +69,7 @@ export function spdxToCdxBom(spdx: SPDX23): CdxBom {
7069
$schema: 'http://cyclonedx.org/schema/bom-1.5.schema.json',
7170
bomFormat: 'CycloneDX',
7271
specVersion: '1.5',
73-
serialNumber: `urn:uuid:${randomUUID()}`,
72+
serialNumber: `urn:uuid:${crypto.randomUUID()}`,
7473
version: 1,
7574
metadata: {
7675
timestamp: spdx.creationInfo.created,

0 commit comments

Comments
 (0)