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

web3-utils

Package Overview
Dependencies
Maintainers
3
Versions
501
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-utils - npm Package Compare versions

Comparing version 1.5.3 to 1.6.0-rc.0

12

lib/utils.js

@@ -25,3 +25,3 @@ /*

var utf8 = require('utf8');
var Hash = require("eth-lib/lib/hash");
var ethereumjsUtil = require('ethereumjs-util');
var ethereumBloomFilters = require('ethereum-bloom-filters');

@@ -432,5 +432,9 @@ /**

if (isHexStrict(value) && /^0x/i.test((value).toString())) {
value = hexToBytes(value);
value = ethereumjsUtil.toBuffer(value);
}
var returnValue = Hash.keccak256(value); // jshint ignore:line
else if (typeof value === 'string') {
// Assume value is an arbitrary string
value = Buffer.from(value, 'utf-8');
}
var returnValue = ethereumjsUtil.bufferToHex(ethereumjsUtil.keccak256(value));
if (returnValue === SHA3_NULL_S) {

@@ -444,3 +448,3 @@ return null;

// expose the under the hood keccak256
sha3._Hash = Hash;
sha3._Hash = ethereumjsUtil.keccak256;
/**

@@ -447,0 +451,0 @@ * @method sha3Raw

{
"name": "web3-utils",
"version": "1.5.3",
"version": "1.6.0-rc.0",
"description": "Collection of utility functions used in web3.js.",

@@ -18,4 +18,4 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-utils",

"bn.js": "^4.11.9",
"eth-lib": "0.2.8",
"ethereum-bloom-filters": "^1.0.6",
"ethereumjs-util": "^7.1.0",
"ethjs-unit": "0.1.6",

@@ -30,3 +30,3 @@ "number-to-bn": "1.7.0",

},
"gitHead": "c82db7a27f593f450208f5acf66b392861f163fa"
"gitHead": "5bc08f8c33f7353c576b21494bacf2413a77f278"
}

@@ -26,7 +26,5 @@ /*

var utf8 = require('utf8');
var Hash = require("eth-lib/lib/hash");
var ethereumjsUtil = require('ethereumjs-util');
var ethereumBloomFilters = require('ethereum-bloom-filters');
/**

@@ -494,6 +492,9 @@ * Returns true if object is BN, otherwise false

if (isHexStrict(value) && /^0x/i.test((value).toString())) {
value = hexToBytes(value);
value = ethereumjsUtil.toBuffer(value);
} else if (typeof value === 'string') {
// Assume value is an arbitrary string
value = Buffer.from(value, 'utf-8');
}
var returnValue = Hash.keccak256(value); // jshint ignore:line
var returnValue = ethereumjsUtil.bufferToHex(ethereumjsUtil.keccak256(value));

@@ -507,3 +508,3 @@ if(returnValue === SHA3_NULL_S) {

// expose the under the hood keccak256
sha3._Hash = Hash;
sha3._Hash = ethereumjsUtil.keccak256;

@@ -510,0 +511,0 @@ /**

{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./lib"
"outDir": "./lib",
"esModuleInterop": true
},

@@ -9,2 +10,2 @@ "include": [

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