chore: update to version 14.0.11 and align website URLs

This commit is contained in:
2026-01-11 11:34:13 +03:00
parent ef74383349
commit 19c8d69bd8
1499 changed files with 53633 additions and 89 deletions
+15
View File
@@ -0,0 +1,15 @@
/**
* @name randomAsNumber
* @summary Creates a random number from random bytes.
* @description
* Returns a random number generated from the secure bytes.
* @example
* <BR>
*
* ```javascript
* import { randomAsNumber } from '@pezkuwi/util-crypto';
*
* randomAsNumber(); // => <random number>
* ```
*/
export declare function randomAsNumber(): number;
+20
View File
@@ -0,0 +1,20 @@
import { BN, hexToBn } from '@pezkuwi/util';
import { randomAsHex } from './asU8a.js';
const BN_53 = new BN(0b11111111111111111111111111111111111111111111111111111);
/**
* @name randomAsNumber
* @summary Creates a random number from random bytes.
* @description
* Returns a random number generated from the secure bytes.
* @example
* <BR>
*
* ```javascript
* import { randomAsNumber } from '@pezkuwi/util-crypto';
*
* randomAsNumber(); // => <random number>
* ```
*/
export function randomAsNumber() {
return hexToBn(randomAsHex(8)).and(BN_53).toNumber();
}
+20
View File
@@ -0,0 +1,20 @@
/**
* @name randomAsU8a
* @summary Creates a Uint8Array filled with random bytes.
* @description
* Returns a `Uint8Array` with the specified (optional) length filled with random bytes.
* @example
* <BR>
*
* ```javascript
* import { randomAsU8a } from '@pezkuwi/util-crypto';
*
* randomAsU8a(); // => Uint8Array([...])
* ```
*/
export declare function randomAsU8a(length?: number): Uint8Array;
/**
* @name randomAsHex
* @description Creates a hex string filled with random bytes.
*/
export declare const randomAsHex: (length?: number | undefined) => import("@pezkuwi/util/types").HexString;
+24
View File
@@ -0,0 +1,24 @@
import { getRandomValues } from '@pezkuwi/x-randomvalues';
import { createAsHex } from '../helpers.js';
/**
* @name randomAsU8a
* @summary Creates a Uint8Array filled with random bytes.
* @description
* Returns a `Uint8Array` with the specified (optional) length filled with random bytes.
* @example
* <BR>
*
* ```javascript
* import { randomAsU8a } from '@pezkuwi/util-crypto';
*
* randomAsU8a(); // => Uint8Array([...])
* ```
*/
export function randomAsU8a(length = 32) {
return getRandomValues(new Uint8Array(length));
}
/**
* @name randomAsHex
* @description Creates a hex string filled with random bytes.
*/
export const randomAsHex = /*#__PURE__*/ createAsHex(randomAsU8a);
+5
View File
@@ -0,0 +1,5 @@
/**
* @summary Returns a sequence of secure random bytes in a variety of formats
*/
export { randomAsNumber } from './asNumber.js';
export { randomAsHex, randomAsU8a } from './asU8a.js';
+5
View File
@@ -0,0 +1,5 @@
/**
* @summary Returns a sequence of secure random bytes in a variety of formats
*/
export { randomAsNumber } from './asNumber.js';
export { randomAsHex, randomAsU8a } from './asU8a.js';