@aws-amplify/auth
Version:
Auth category of aws-amplify
1 lines • 909 B
Source Map (JSON)
{"version":3,"file":"getRandomBytes.mjs","sources":["../../../../../../src/providers/cognito/utils/srp/getRandomBytes.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { WordArray } from '@aws-amplify/core/internals/utils';\nimport { getBytesFromHex } from './getBytesFromHex';\n/**\n * Returns a Uint8Array with a sequence of random nBytes\n *\n * @param {number} nBytes\n * @returns {Uint8Array} fixed-length sequence of random bytes\n */\nexport const getRandomBytes = (nBytes) => {\n const str = new WordArray().random(nBytes).toString();\n return getBytesFromHex(str);\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG,CAAC,MAAM,KAAK;AAC1C,IAAI,MAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;AACzD,IAAI,OAAO,eAAe,CAAC,GAAG,CAAC;AAC/B;;;;"}