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

@cardano-sdk/util

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cardano-sdk/util - npm Package Compare versions

Comparing version 0.15.0 to 0.15.1

2

dist/cjs/equals.d.ts
export declare const deepEquals: <T>(a: T, b: T) => boolean;
export declare const strictEquals: <T>(a: T, b: T) => boolean;
export declare const sameArrayItems: <T>(arrayA: T[], arrayB: T[], itemEquals: (a: T, b: T) => boolean) => boolean;
export declare const areNumbersEqualInConstantTime: (a: number, b: number) => boolean;
export declare const areStringsEqualInConstantTime: (a: string, b: string) => boolean;
//# sourceMappingURL=equals.d.ts.map

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.sameArrayItems = exports.strictEquals = exports.deepEquals = void 0;
exports.areStringsEqualInConstantTime = exports.areNumbersEqualInConstantTime = exports.sameArrayItems = exports.strictEquals = exports.deepEquals = void 0;
const isEqual_1 = __importDefault(require("lodash/isEqual"));

@@ -15,2 +15,11 @@ const deepEquals = (a, b) => (0, isEqual_1.default)(a, b);

exports.sameArrayItems = sameArrayItems;
const areNumbersEqualInConstantTime = (a, b) => (a ^ b) === 0;
exports.areNumbersEqualInConstantTime = areNumbersEqualInConstantTime;
const areStringsEqualInConstantTime = (a, b) => {
const maxLength = Math.max(a.length, b.length);
const results = Array.from({ length: maxLength }, (_, i) => (a.charCodeAt(i) === b.charCodeAt(i) ? 1 : 0));
const areAllCharactersEqual = results.reduce((accumulator, currentValue) => (accumulator & currentValue), 1);
return areAllCharactersEqual === 1;
};
exports.areStringsEqualInConstantTime = areStringsEqualInConstantTime;
//# sourceMappingURL=equals.js.map
export declare const deepEquals: <T>(a: T, b: T) => boolean;
export declare const strictEquals: <T>(a: T, b: T) => boolean;
export declare const sameArrayItems: <T>(arrayA: T[], arrayB: T[], itemEquals: (a: T, b: T) => boolean) => boolean;
export declare const areNumbersEqualInConstantTime: (a: number, b: number) => boolean;
export declare const areStringsEqualInConstantTime: (a: string, b: string) => boolean;
//# sourceMappingURL=equals.d.ts.map

@@ -5,2 +5,9 @@ import isEqual from 'lodash/isEqual';

export const sameArrayItems = (arrayA, arrayB, itemEquals) => arrayA.length === arrayB.length && arrayA.every((a) => arrayB.some((b) => itemEquals(a, b)));
export const areNumbersEqualInConstantTime = (a, b) => (a ^ b) === 0;
export const areStringsEqualInConstantTime = (a, b) => {
const maxLength = Math.max(a.length, b.length);
const results = Array.from({ length: maxLength }, (_, i) => (a.charCodeAt(i) === b.charCodeAt(i) ? 1 : 0));
const areAllCharactersEqual = results.reduce((accumulator, currentValue) => (accumulator & currentValue), 1);
return areAllCharactersEqual === 1;
};
//# sourceMappingURL=equals.js.map

4

package.json
{
"name": "@cardano-sdk/util",
"version": "0.15.0",
"version": "0.15.1",
"description": "General, not cardano-specific utils",

@@ -64,3 +64,3 @@ "engines": {

],
"gitHead": "17887140f948a61653e01c781c7aa6e3e40d9e38"
"gitHead": "68b4b7472d6058778c61a8680705211b7db6abb2"
}

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 not supported yet

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 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