diff --git a/harmony_utils/src/main/ets/crypto/CryptoHelper.ets b/harmony_utils/src/main/ets/crypto/CryptoHelper.ets index 3e29dde5fa44a8e2ec7d0d0b67c08cfc95b20585..c3f08c268b25e232dec3743ae5c81f736d19746a 100644 --- a/harmony_utils/src/main/ets/crypto/CryptoHelper.ets +++ b/harmony_utils/src/main/ets/crypto/CryptoHelper.ets @@ -140,11 +140,7 @@ export class CryptoHelper { * @returns */ static getRandomUint8Array(size: number): Uint8Array { - let randArray = new Array(); - for (let i = 0; i < size; i++) { - randArray.push(Math.floor(Math.random() * 256)); - } - return new Uint8Array(randArray); + return cryptoFramework.createRandom().generateRandomSync(size).data; }