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

@requestnetwork/utils

Package Overview
Dependencies
Maintainers
5
Versions
688
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@requestnetwork/utils - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.8.0](https://github.com/RequestNetwork/requestNetwork/compare/@requestnetwork/utils@0.7.0...@requestnetwork/utils@0.8.0) (2019-12-04)
### Features
* add ETH paymentNetwork to request-client ([#617](https://github.com/RequestNetwork/requestNetwork/issues/617)) ([84ed64e](https://github.com/RequestNetwork/requestNetwork/commit/84ed64ebf96a296155dc2d4d5e6c538344fb881b))
# [0.7.0](https://github.com/RequestNetwork/requestNetwork/compare/@requestnetwork/utils@0.6.2...@requestnetwork/utils@0.7.0) (2019-11-20)

@@ -8,0 +19,0 @@

@@ -18,2 +18,3 @@ /// <reference types="node" />

generate32BufferKey: typeof generate32BufferKey;
generate8randomBytes: typeof generate8randomBytes;
keccak256Hash: typeof keccak256Hash;

@@ -56,2 +57,10 @@ normalize: typeof normalize;

declare function generate32BufferKey(): Promise<string>;
/**
* Generate 8 random bytes and return as a hexadecimal string.
* Used for salt in ETH input data.
* Example: 'ea3bc7caf64110ca'
*
* @returns a string of 8 random bytes
*/
declare function generate8randomBytes(): string;
//# sourceMappingURL=crypto.d.ts.map

@@ -24,2 +24,3 @@ "use strict";

generate32BufferKey,
generate8randomBytes,
keccak256Hash,

@@ -77,2 +78,23 @@ normalize,

}
// eslint-disable-next-line spellcheck/spell-checker
/**
* Generate 8 random bytes and return as a hexadecimal string.
* Used for salt in ETH input data.
* Example: 'ea3bc7caf64110ca'
*
* @returns a string of 8 random bytes
*/
function generate8randomBytes() {
const base16 = 16;
const generate4randomBytes = () => {
// A 4 byte random integer
const randomInteger = Math.floor(Math.random() * Math.pow(2, 4 * 8));
// Convert to hexadecimal and padded with 0
return randomInteger.toString(base16).padStart(8, '0');
};
// Do it in 2 passes because an integer doesn't have enough bits
const high = generate4randomBytes();
const low = generate4randomBytes();
return high + low;
}
//# sourceMappingURL=crypto.js.map

1

dist/index.d.ts

@@ -26,2 +26,3 @@ /// <reference types="node" />

generate32BufferKey: () => Promise<string>;
generate8randomBytes: () => string;
keccak256Hash: (data: string) => string;

@@ -28,0 +29,0 @@ normalize: (data: any) => string;

9

package.json
{
"name": "@requestnetwork/utils",
"version": "0.7.0",
"version": "0.8.0",
"publishConfig": {

@@ -43,3 +43,3 @@ "access": "public"

"dependencies": {
"@requestnetwork/types": "0.9.0",
"@requestnetwork/types": "0.9.1",
"bn.js": "4.11.8",

@@ -52,2 +52,3 @@ "eth-crypto": "1.5.0"

"@types/mocha": "5.2.6",
"@types/sinon": "7.5.0",
"@typescript-eslint/parser": "1.2.0",

@@ -65,3 +66,3 @@ "chai": "4.2.0",

"shx": "0.3.2",
"sinon": "7.3.2",
"sinon": "7.5.0",
"source-map-support": "0.5.13",

@@ -71,3 +72,3 @@ "tslint": "5.12.1",

},
"gitHead": "f1cf2391046d07d642443c77995aed3010cf98d7"
"gitHead": "338a1f0041637beb5ff58d0996566d57e229cd7c"
}

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