ethereumjs-util
Advanced tools
Comparing version 6.2.0 to 6.2.1
@@ -9,2 +9,10 @@ # Changelog | ||
## [6.2.1] - 2020-07-17 | ||
This release replaces the native `secp256k1` and `keccak` dependencies with | ||
[ethereum-cryptopgraphy](https://github.com/ethereum/js-ethereum-cryptography) | ||
which doesn't need native compilation. | ||
[6.2.1]: https://github.com/ethereumjs/ethereumjs-util/compare/v6.2.0...v6.2.1 | ||
## [6.2.0] - 2019-11-06 | ||
@@ -11,0 +19,0 @@ |
@@ -43,7 +43,7 @@ /// <reference types="node" /> | ||
*/ | ||
export declare const generateAddress2: (from: string | Buffer, salt: string | Buffer, initCode: string | Buffer) => Buffer; | ||
export declare const generateAddress2: (from: Buffer | string, salt: Buffer | string, initCode: Buffer | string) => Buffer; | ||
/** | ||
* Returns true if the supplied address belongs to a precompiled account (Byzantium). | ||
*/ | ||
export declare const isPrecompiled: (address: string | Buffer) => boolean; | ||
export declare const isPrecompiled: (address: Buffer | string) => boolean; | ||
/** | ||
@@ -50,0 +50,0 @@ * Checks if the private key satisfies the rules of the curve secp256k1. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.importPublic = exports.privateToPublic = exports.privateToAddress = exports.publicToAddress = exports.pubToAddress = exports.isValidPublic = exports.isValidPrivate = exports.isPrecompiled = exports.generateAddress2 = exports.generateAddress = exports.isValidChecksumAddress = exports.toChecksumAddress = exports.isZeroAddress = exports.isValidAddress = exports.zeroAddress = void 0; | ||
var assert = require('assert'); | ||
var ethjsUtil = require('ethjs-util'); | ||
var secp256k1 = require('secp256k1'); | ||
var secp256k1 = require('./secp256k1v3-adapter'); | ||
var BN = require("bn.js"); | ||
@@ -7,0 +8,0 @@ var bytes_1 = require("./bytes"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.baToJSON = exports.addHexPrefix = exports.toUnsigned = exports.fromSigned = exports.bufferToHex = exports.bufferToInt = exports.toBuffer = exports.stripZeros = exports.unpad = exports.setLengthRight = exports.setLength = exports.setLengthLeft = exports.zeros = void 0; | ||
var ethjsUtil = require('ethjs-util'); | ||
@@ -4,0 +5,0 @@ var BN = require("bn.js"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KECCAK256_RLP = exports.KECCAK256_RLP_S = exports.KECCAK256_RLP_ARRAY = exports.KECCAK256_RLP_ARRAY_S = exports.KECCAK256_NULL = exports.KECCAK256_NULL_S = exports.TWO_POW256 = exports.MAX_INTEGER = void 0; | ||
var BN = require("bn.js"); | ||
@@ -4,0 +5,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var createKeccakHash = require('keccak'); | ||
exports.rlphash = exports.ripemd160 = exports.sha256 = exports.keccak256 = exports.keccak = void 0; | ||
var _a = require('ethereum-cryptography/keccak'), keccak224 = _a.keccak224, keccak384 = _a.keccak384, k256 = _a.keccak256, keccak512 = _a.keccak512; | ||
var createHash = require('create-hash'); | ||
@@ -24,5 +25,19 @@ var ethjsUtil = require('ethjs-util'); | ||
bits = 256; | ||
return createKeccakHash("keccak" + bits) | ||
.update(a) | ||
.digest(); | ||
switch (bits) { | ||
case 224: { | ||
return keccak224(a); | ||
} | ||
case 256: { | ||
return k256(a); | ||
} | ||
case 384: { | ||
return keccak384(a); | ||
} | ||
case 512: { | ||
return keccak512(a); | ||
} | ||
default: { | ||
throw new Error("Invald algorithm: keccak" + bits); | ||
} | ||
} | ||
}; | ||
@@ -29,0 +44,0 @@ /** |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var secp256k1 = require('secp256k1'); | ||
exports.secp256k1 = exports.rlp = exports.BN = void 0; | ||
var secp256k1 = require('./secp256k1v3-adapter'); | ||
exports.secp256k1 = secp256k1; | ||
@@ -17,23 +25,23 @@ var ethjsUtil = require('ethjs-util'); | ||
*/ | ||
__export(require("./constants")); | ||
__exportStar(require("./constants"), exports); | ||
/** | ||
* Public-key cryptography (secp256k1) and addresses | ||
*/ | ||
__export(require("./account")); | ||
__exportStar(require("./account"), exports); | ||
/** | ||
* Hash functions | ||
*/ | ||
__export(require("./hash")); | ||
__exportStar(require("./hash"), exports); | ||
/** | ||
* ECDSA signature | ||
*/ | ||
__export(require("./signature")); | ||
__exportStar(require("./signature"), exports); | ||
/** | ||
* Utilities for manipulating Buffers, byte arrays, etc. | ||
*/ | ||
__export(require("./bytes")); | ||
__exportStar(require("./bytes"), exports); | ||
/** | ||
* Function for definining properties on an object | ||
*/ | ||
__export(require("./object")); | ||
__exportStar(require("./object"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.defineProperties = void 0; | ||
var assert = require('assert'); | ||
@@ -4,0 +5,0 @@ var ethjsUtil = require('ethjs-util'); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var secp256k1 = require('secp256k1'); | ||
exports.hashPersonalMessage = exports.isValidSignature = exports.fromRpcSig = exports.toRpcSig = exports.ecrecover = exports.ecsign = void 0; | ||
var secp256k1 = require('./secp256k1v3-adapter'); | ||
var BN = require("bn.js"); | ||
@@ -5,0 +6,0 @@ var bytes_1 = require("./bytes"); |
{ | ||
"name": "ethereumjs-util", | ||
"version": "6.2.0", | ||
"version": "6.2.1", | ||
"description": "a collection of utility functions for Ethereum", | ||
@@ -94,6 +94,6 @@ "main": "dist/index.js", | ||
"create-hash": "^1.1.2", | ||
"ethereum-cryptography": "^0.1.3", | ||
"elliptic": "^6.5.2", | ||
"ethjs-util": "0.1.6", | ||
"keccak": "^2.0.0", | ||
"rlp": "^2.2.3", | ||
"secp256k1": "^3.0.1" | ||
"rlp": "^2.2.3" | ||
}, | ||
@@ -100,0 +100,0 @@ "devDependencies": { |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
131463
34
2178
0
+ Addedelliptic@^6.5.2
+ Addedethereum-cryptography@^0.1.3
+ Added@types/pbkdf2@3.1.2(transitive)
+ Added@types/secp256k1@4.0.6(transitive)
+ Addedbase-x@3.0.10(transitive)
+ Addedblakejs@1.2.1(transitive)
+ Addedbs58@4.0.1(transitive)
+ Addedbs58check@2.1.2(transitive)
+ Addedethereum-cryptography@0.1.3(transitive)
+ Addedkeccak@3.0.4(transitive)
+ Addednode-addon-api@2.0.2(transitive)
+ Addednode-gyp-build@4.8.2(transitive)
+ Addedpbkdf2@3.1.2(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedscrypt-js@3.0.1(transitive)
+ Addedsecp256k1@4.0.3(transitive)
+ Addedsetimmediate@1.0.5(transitive)
- Removedkeccak@^2.0.0
- Removedsecp256k1@^3.0.1
- Removedbindings@1.5.0(transitive)
- Removedbip66@1.1.5(transitive)
- Removeddrbg.js@1.0.1(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedkeccak@2.1.0(transitive)
- Removednan@2.20.0(transitive)
- Removedsecp256k1@3.8.0(transitive)