Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zilliqa-js/util

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zilliqa-js/util - npm Package Compare versions

Comparing version 0.3.0 to 0.3.3

11

dist/bytes.d.ts

@@ -38,2 +38,13 @@ /**

/**
* pack
*
* Takes two 16-bit integers and combines them. Used to compute version.
*
* @param {number} a
* @param {number} b
*
* @returns {number} - a 32-bit number
*/
export declare const pack: (a: number, b: number) => number;
/**
* compareBytes

@@ -40,0 +51,0 @@ *

@@ -85,2 +85,18 @@ "use strict";

/**
* pack
*
* Takes two 16-bit integers and combines them. Used to compute version.
*
* @param {number} a
* @param {number} b
*
* @returns {number} - a 32-bit number
*/
exports.pack = function (a, b) {
if (a >> 16 > 0 || b >> 16 > 0) {
throw new Error('Both a and b must be 16 bits or less');
}
return (a << 16) + b;
};
/**
* compareBytes

@@ -87,0 +103,0 @@ *

4

package.json
{
"name": "@zilliqa-js/util",
"version": "0.3.0",
"version": "0.3.3",
"description": "Utilities for working with Zillia.",

@@ -26,3 +26,3 @@ "main": "dist/index.js",

},
"gitHead": "7099301a8c3cde45cf083f9f947ba6461001c927"
"gitHead": "70062a8d95d22c313a6261d23d7a140cf3e43cd3"
}

@@ -71,2 +71,16 @@ # @zilliqa-js/util

### `pack(a: number, b: number): number`
Performs bitwise addition of two 16-bit numbers, returning a 32-bit number.
Throws if either number exceeds 16 bits.
**Parameters**
- `a`: `number` - a 16-bit number.
- `b`: `number` - a 16-bit number.
**Returns**
- `number` - the combined 32-bit number.
### `compareBytes(a: string, b: string): boolean`

@@ -73,0 +87,0 @@

@@ -101,2 +101,20 @@ /**

/**
* pack
*
* Takes two 16-bit integers and combines them. Used to compute version.
*
* @param {number} a
* @param {number} b
*
* @returns {number} - a 32-bit number
*/
export const pack = (a: number, b: number): number => {
if (a >> 16 > 0 || b >> 16 > 0) {
throw new Error('Both a and b must be 16 bits or less');
}
return (a << 16) + b;
};
/**
* compareBytes

@@ -103,0 +121,0 @@ *

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc