1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.generatePseudoRandom256BitNumber = void 0;
|
4 | const configured_bignumber_1 = require("./configured_bignumber");
|
5 | const MAX_DIGITS_IN_UNSIGNED_256_INT = 78;
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | function generatePseudoRandom256BitNumber() {
|
11 |
|
12 |
|
13 | const randomNumber = configured_bignumber_1.BigNumber.random(MAX_DIGITS_IN_UNSIGNED_256_INT);
|
14 | const factor = new configured_bignumber_1.BigNumber(10).pow(MAX_DIGITS_IN_UNSIGNED_256_INT - 1);
|
15 | const randomNumberScaledTo256Bits = randomNumber.times(factor).integerValue();
|
16 | return randomNumberScaledTo256Bits;
|
17 | }
|
18 | exports.generatePseudoRandom256BitNumber = generatePseudoRandom256BitNumber;
|
19 |
|
\ | No newline at end of file |