Skip to content

Commit

Permalink
Fix code scanning alert no. 49: Insecure randomness
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 4f60be3 commit 9269aac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion feature-libs/cart/base/core/facade/multi-cart.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export class MultiCartService implements MultiCartFacade {
* Simple random temp cart id generator
*/
protected generateTempCartId(): string {
const pseudoUuid = Math.random().toString(36).substring(2, 11);
const array = new Uint32Array(1);
window.crypto.getRandomValues(array);
const pseudoUuid = array[0].toString(36).substring(2, 11);
return `temp-${pseudoUuid}`;
}

Expand Down

0 comments on commit 9269aac

Please sign in to comment.