@aws-amplify/core
Version:
Core category of aws-amplify
1 lines • 840 B
Source Map (JSON)
{"version":3,"file":"cryptoSecureRandomInt.mjs","sources":["../../../src/utils/cryptoSecureRandomInt.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getCrypto } from './globalHelpers';\n/*\n * Cryptographically secure pseudorandom number generator\n * As Math.random() is cryptographically not safe to use\n */\nexport function cryptoSecureRandomInt() {\n const crypto = getCrypto();\n const randomResult = crypto.getRandomValues(new Uint32Array(1))[0];\n return randomResult;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACO,SAAS,qBAAqB,GAAG;AACxC,IAAI,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;AAC/B,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,IAAI,OAAO,YAAY,CAAC;AACxB;;;;"}