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
+5
View File
@@ -0,0 +1,5 @@
/**
* @summary Utility methods to convert to and from `number` values
*/
export { numberToHex } from './toHex.js';
export { numberToU8a } from './toU8a.js';
+5
View File
@@ -0,0 +1,5 @@
/**
* @summary Utility methods to convert to and from `number` values
*/
export { numberToHex } from './toHex.js';
export { numberToU8a } from './toU8a.js';
+17
View File
@@ -0,0 +1,17 @@
import type { HexString } from '../types.js';
/**
* @name numberToHex
* @summary Creates a hex value from a number.
* @description
* `null`/`undefined`/`NaN` inputs returns an empty `0x` result. `number` input values return the actual bytes value converted to a `hex`. With `bitLength` set, it converts the number to the equivalent size.
* @example
* <BR>
*
* ```javascript
* import { numberToHex } from '@pezkuwi/util';
*
* numberToHex(0x1234); // => '0x1234'
* numberToHex(0x1234, 32); // => 0x00001234
* ```
*/
export declare function numberToHex(value?: number | null, bitLength?: number): HexString;
+20
View File
@@ -0,0 +1,20 @@
import { hexFixLength } from '../hex/fixLength.js';
/**
* @name numberToHex
* @summary Creates a hex value from a number.
* @description
* `null`/`undefined`/`NaN` inputs returns an empty `0x` result. `number` input values return the actual bytes value converted to a `hex`. With `bitLength` set, it converts the number to the equivalent size.
* @example
* <BR>
*
* ```javascript
* import { numberToHex } from '@pezkuwi/util';
*
* numberToHex(0x1234); // => '0x1234'
* numberToHex(0x1234, 32); // => 0x00001234
* ```
*/
export function numberToHex(value, bitLength = -1) {
const hex = (!value || Number.isNaN(value) ? 0 : value).toString(16);
return hexFixLength(hex.length % 2 ? `0${hex}` : hex, bitLength, true);
}
+15
View File
@@ -0,0 +1,15 @@
/**
* @name numberToU8a
* @summary Creates a Uint8Array object from a number.
* @description
* `null`/`undefined`/`NaN` inputs returns an empty `Uint8Array` result. `number` input values return the actual bytes value converted to a `Uint8Array`. With `bitLength`, it converts the value to the equivalent size.
* @example
* <BR>
*
* ```javascript
* import { numberToU8a } from '@pezkuwi/util';
*
* numberToU8a(0x1234); // => [0x12, 0x34]
* ```
*/
export declare function numberToU8a(value?: number | null, bitLength?: number): Uint8Array;
+19
View File
@@ -0,0 +1,19 @@
import { hexToU8a } from '../hex/toU8a.js';
import { numberToHex } from './toHex.js';
/**
* @name numberToU8a
* @summary Creates a Uint8Array object from a number.
* @description
* `null`/`undefined`/`NaN` inputs returns an empty `Uint8Array` result. `number` input values return the actual bytes value converted to a `Uint8Array`. With `bitLength`, it converts the value to the equivalent size.
* @example
* <BR>
*
* ```javascript
* import { numberToU8a } from '@pezkuwi/util';
*
* numberToU8a(0x1234); // => [0x12, 0x34]
* ```
*/
export function numberToU8a(value, bitLength = -1) {
return hexToU8a(numberToHex(value, bitLength));
}