mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 06:47:57 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
import type { HexString } from '../types.js';
|
||||
/**
|
||||
* @name hexFixLength
|
||||
* @summary Shifts a hex string to a specific bitLength
|
||||
* @description
|
||||
* Returns a `0x` prefixed string with the specified number of bits contained in the return value. (If bitLength is -1, length checking is not done). Values with more bits are trimmed to the specified length. Input values with less bits are returned as-is by default. When `withPadding` is set, shorter values are padded with `0`.
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* import { hexFixLength } from '@pezkuwi/util';
|
||||
*
|
||||
* console.log('fixed', hexFixLength('0x12', 16)); // => 0x12
|
||||
* console.log('fixed', hexFixLength('0x12', 16, true)); // => 0x0012
|
||||
* console.log('fixed', hexFixLength('0x0012', 8)); // => 0x12
|
||||
* ```
|
||||
*/
|
||||
export declare function hexFixLength(value: string, bitLength?: number, withPadding?: boolean): HexString;
|
||||
Reference in New Issue
Block a user