Skip to content

Commit 0cac120

Browse files
committed
chore/debug: use named import from node:crypto
other elements of the codebase do the same thing
1 parent b0be46a commit 0cac120

File tree

1 file changed

+2
-2
lines changed
  • apps/site/components/Common/Partners

1 file changed

+2
-2
lines changed

apps/site/components/Common/Partners/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import crypto from 'node:crypto';
1+
import { createHash } from 'node:crypto';
22

33
import type {
44
RandomPartnerListConfig,
@@ -8,7 +8,7 @@ import type {
88
// Fisher-Yates shuffle algorithm with a seed for deterministic results
99
function shuffle(array: Array<Partners>, seed: number): Array<Partners> {
1010
const shuffled = [...array];
11-
const hash = crypto.createHash('sha256').update(String(seed)).digest();
11+
const hash = createHash('sha256').update(String(seed)).digest();
1212

1313
for (let i = shuffled.length - 1; i > 0; i--) {
1414
// Use hash bytes to generate deterministic "random" index

0 commit comments

Comments
 (0)