
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
@zilliqa-js/util
Advanced tools
Utility functions useful in Zilliqa-related programs.
BNSee documentation at bn.js. This is
simply a re-export of that library to prevent bloating other @zilliqa-js
packages, most of which depend on bn.js in small ways.
LongSee documentation at long.js. This is
simply a re-export for similar reasons. Note that long is only required if
you need to serialise integers with size greater than or equal to 2^53.
intToHexArray(int: number, size: number): string[]Converts an integer to an array of hexadecimal strings (little endian). Size is the total length of bytes to pad to.
Parameters
int: number - the decimal number to convert.Returns
string[] - hexadecimal array representation of the decimal number.intToByteArray(num: number, size: number): Uint8ArrayConverts an integer to a Uint8Array (i.e., byte array).
Parameters
num: number - the decimal number to convertReturns
Uint8Array - byte array, padded to size.hexToByteArray(hex: string): Uint8ArrayConverts a hex-encoded string to a Uint8Array. Endianess is not important.
Parameters
hex: stringReturns
Uint8ArrayhexToIntArray(hex: string): number[]Converts a hex-encoded string to an array of integers.
Parameters
hex: stringReturns
number[]compareBytes(a: string, b: string): booleanPerforms a constant time comparison of two hexadecimal values. This avoids timing attacks.
Parameters
a: string - hex-encoded string.b: string - hex-encoded string.Returns
boolean - true if the values are equal.isHex(str: string): booleanDetermines if a given string is hex-encoded.
Parameters
str: string.Returns
boolean - true if the string is hex-encoded.isAddress(address: string): booleanDetermines if a given string is a valid address.
Parameters
address: string.Returns
boolean - true if the string is an address.isPrivateKey(privateKey: string): booleanDetermines if a given string is a valid private key.
Parameters
privateKey: string.Returns
boolean - true if the string is a valid private key.isPubKey(pubKey: string): booleanDetermines if a given string is a valid uncompressed public key.
Parameters
pubKey: string.Returns
boolean - true if the string is a valid public key.isSignature(sig: string): booleanDetermines if a given string is a valid Schnorr signature.
Parameters
sig: stringReturns
boolean - true if the string is a valid signature.isNumber(x: unknown): booleanDetermines if a given value is a valid JS number.
Parameters
x: unknownReturns
boolean - true if the string is a valid signature.isBN(x: unknown): booleanDetermines if a given value is an instance of BN.js.
Parameters
x: unknownReturns
boolean - true if the value is a BN instance.isString(x: unknown): booleanDetermines if a given value is a valid JS string.
Parameters
x: unknownReturns
boolean - true if the value is a string.isPlainObject(x: unknown): booleanDetermines if a given value is a plain JS object (i.e. directly below
Object in the prototype chain).
Parameters
x: unknownReturns
boolean - true if the value is a plain object.matchesObject(x: unknown, test: { [key: string]: Validator[] }): booleanDetermines if a value has the shape specified by test.
Parameters
x: unknowntest: { [key: string]: Validator[] }Returns
boolean - true if the value matches test.FAQs
Utilities for working with Zilliqa.
We found that @zilliqa-js/util demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.