7.1.5 • Published 2 years ago

ethereumjs-util v7.1.5

Weekly downloads
453,141
License
MPL-2.0
Repository
github
Last release
2 years ago

ethereumjs-util

NPM Package GitHub Issues Actions Status Code Coverage Discord

A collection of utility functions for Ethereum. It can be used in Node.js and in the browser with browserify.

INSTALL

npm install ethereumjs-util

USAGE

import assert from 'assert'
import { isValidChecksumAddress, unpadBuffer, BN } from 'ethereumjs-util'

assert.ok(isValidChecksumAddress('0x2F015C60E0be116B1f0CD534704Db9c92118FB6A'))

assert.ok(unpadBuffer(Buffer.from('000000006600', 'hex')).equals(Buffer.from('6600', 'hex')))

assert.ok(new BN('dead', 16).add(new BN('101010', 2)).eqn(57047))

API

Documentation

Read the API docs.

Modules

  • account
    • Account class
    • Private/public key and address-related functionality (creation, validation, conversion)
  • address
    • Address class and type
  • bytes
    • Byte-related helper and conversion functions
  • constants
    • Exposed constants
      • e.g. KECCAK256_NULL_S for string representation of Keccak-256 hash of null
  • hash
    • Hash functions
  • object
    • Helper function for creating a binary object (DEPRECATED)
  • signature
    • Signing, signature validation, conversion, recovery
  • types
    • Helpful TypeScript types
  • internal
    • Internalized helper methods
  • externals
    • Re-exports of BN, rlp

ethjs-util methods

The following methods are available by an internalized version of the ethjs-util package (MIT license), see internal.ts. The original package is not maintained any more and the original functionality will be replaced by own implementations over time (starting with the v7.1.3 release, October 2021).

  • arrayContainsArray
  • getBinarySize
  • stripHexPrefix
  • isHexPrefixed
  • isHexString
  • padToEven
  • fromAscii
  • fromUtf8
  • toUtf8
  • toAscii
  • getKeys

They can be imported by name:

import { stripHexPrefix } from 'ethereumjs-util'

Re-Exports

ethereumjs-util re-exports the following commonly-used libraries:

They can be imported by name:

import { BN, rlp } from 'ethereumjs-util'

EthereumJS

See our organizational documentation for an introduction to EthereumJS as well as information on current standards and best practices.

If you want to join for work or do improvements on the libraries have a look at our contribution guidelines.

LICENSE

MPL-2.0

@alebusse/account-lib@thorswap-lib/hdwallet-ledger@poofcash/poof-tokenalebusse@do-killer/dodo-wallet@do-killer/dodo-wallet2@debuggor/ethereumjs-walletdebuggor-signdapid-identity-ethereum@dojimanetwork/core@dojimanetwork/dojimajs@syoonk/perijsaei-contract@jdutchak/argosidchain-nodewebbhp-jsethereumjs-wallet-browsereth-client@evtest/account-0@evtest/account-1smc-module@amra-finance/ding@amra-finance/ding-plugin-ledger-web@amra-finance/ding-plugin-trezor-webcode_hashcyber-host-cli@ethereumjs/accountqkc-qweb3@bhpnet/bhpnet-js-sdkbhpnetbhpnet-jsbhpnetwork-jsweidentityjs-utils@coinspace/cs-ethereum-wallet@owen05/dodo-contractindex-daoindex-coopicon-signature-util@minden-matic/maticjshtdf_web3_ordinaryweb3_htdfhdwalletcoinoxs@thesis-co/mechamittens-extensionperi-finance-jssecux-connect@bitexchange-ltd/bitexchange-server-7.5.0-beta.3token-sdk-server@horizon-protocol/horizon-js@safepay0x/core@safepay0x/libraries@safepay0x/peripheryerc891-minercehhgold-minerdrawer-farmer-wealth-idea@fairlyhonest/state-channel@radar/setprotocol.jssonnguyen-refinable-jsfp-operator@skalenetwork/skale.jsbitsong-js-sdkbitsong-js-utilbitsong-js-walletbitsong-js-txbnc-onboard-metamask@castframework/chain-auth@castframework/oracles@txdev/ethereumjs-abinoah-js-orgnoah-js-sdkarcexs@dzhanavapp/minter-js-sdk@fairlyhonest/eip712-utils@txdev/element-js-v2deen_soltest-zdk-dev@micdeb-ariane/hweb3-eth-accounts@micdeb-ariane/hweb3-utils@mazarine-sea/maz-keyringinterlinked-protocol-agentinterlinked-sdksolidity-commoncompass-eth-dbweedle-cli@alias-earth/coreopensea-wallet-providerarthcoin.js@txdev/nft-wallet@dodoex-io/walleteth-hd-keyring-qbck@trustline-inc/keystore-gen@infinitebrahmanuniverse/nolb-ethehumanwallet@unizen-io/unizen-trade-aggregatorblocase-clientcosmos-crypto-lib@layerzerolabs/layerzero-v2-solana-sdkpoof-tokenwallet-bunkerscw-contracts@everything-registry/sub-chunk-1619
7.1.5

2 years ago

7.1.4

3 years ago

7.1.3

3 years ago

7.1.2

3 years ago

7.1.1

3 years ago

7.1.0

3 years ago

7.0.10

4 years ago

7.0.9

4 years ago

7.0.8

4 years ago

7.0.7

4 years ago

7.0.6

4 years ago

7.0.5

4 years ago

7.0.4

4 years ago

5.2.1

4 years ago

6.2.1

4 years ago

4.5.1

4 years ago

7.0.3

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

7.0.0

5 years ago

6.2.0

5 years ago

6.1.0

6 years ago

6.0.0

6 years ago

5.2.0

7 years ago

5.1.5

7 years ago

5.1.4

7 years ago

5.1.3

7 years ago

5.1.2

7 years ago

5.1.1

8 years ago

5.1.0

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago

4.5.0

8 years ago

4.4.1

8 years ago

4.4.0

9 years ago

4.3.1

9 years ago

4.3.0

9 years ago

4.2.0

9 years ago

4.1.0

9 years ago

4.0.2

9 years ago

4.0.1

9 years ago

4.0.0

9 years ago

3.0.0

9 years ago

2.7.0

9 years ago

2.6.0

9 years ago

2.5.0

9 years ago

2.4.0

9 years ago

2.3.2

9 years ago

2.3.1

9 years ago

2.3.0

9 years ago

2.2.0

9 years ago

2.1.0

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.8

9 years ago

1.3.7

9 years ago

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.0

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago