mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Use WebCrypto to generate all random numbers and strings (#9786)
This commit is contained in:
committed by
GitHub
parent
cfc4db00e3
commit
65c5609ab5
@@ -1,9 +1,10 @@
|
||||
import { NodeVM } from '@n8n/vm2';
|
||||
import { type IExecuteFunctions, type INodeExecutionData, NodeOperationError } from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { NodeOperationError, randomInt } from 'n8n-workflow';
|
||||
|
||||
export const shuffleArray = (array: any[]) => {
|
||||
for (let i = array.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
const j = randomInt(i + 1);
|
||||
[array[i], array[j]] = [array[j], array[i]];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user