- Notifications
You must be signed in to change notification settings - Fork274
Project is in active development and has been moved to the EthereumJS monorepo.
License
ethereumjs/ethereumjs-util
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A collection of utility functions for Ethereum. It can be used in Node.js and in the browser withbrowserify.
npm install ethereumjs-util
importassertfrom'assert'import{isValidChecksumAddress,unpadBuffer,BN}from'ethereumjs-util'constaddress='0x2F015C60E0be116B1f0CD534704Db9c92118FB6A'assert.ok(isValidChecksumAddress(address))assert.equal(unpadBuffer(Buffer.from('000000006600','hex')),Buffer.from('6600','hex'))assert.equal(newBN('dead',16).add(newBN('101010',2)),57047)
- 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
- Exposed constants
- hash
- Hash functions
- object
- Helper function for creating a binary object (
DEPRECATED
)
- Helper function for creating a binary object (
- signature
- Signing, signature validation, conversion, recovery
- types
- Helpful TypeScript types
- externals
- Helper methods from
ethjs-util
- Re-exports of
BN
,rlp
- Helper methods from
The following methods are available provided byethjs-util:
- arrayContainsArray
- toBuffer
- getBinarySize
- stripHexPrefix
- isHexPrefixed
- isHexString
- padToEven
- intToHex
- fromAscii
- fromUtf8
- toUtf8
- toAscii
- getKeys
They can be imported by name:
import{intToHex,stripHexPrefix}from'ethereumjs-util'
Additionallyethereumjs-util
re-exports a few commonly-used libraries. These include:
See our organizationaldocumentation for an introduction toEthereumJS
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 ourcontribution guidelines.
MPL-2.0
About
Project is in active development and has been moved to the EthereumJS monorepo.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.