New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nahmii-ethereum-address

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nahmii-ethereum-address

A small utility for parsing, validating and converting ethereum addresses

  • 2.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
3
Weekly downloads
 
Created
Source

ETHEREUM-ADDRESS

This is a small utility library for parsing, validating and converting an ethereum address.

Installation

npm install nahmii-ethereum-address

Usage

Creating a new address from a string:


    const EthereumAddress = require('nahmii-ethereum-address');

    let addr = EthereumAddress.from('0x0011223344556677889900112233445566778899');

    if (!addr)
        console.log('Address is not valid');

EthereumAddress - constructor()

The constructor can be invoked with either a 20 byte Buffer or an already existing EthereumAddress instance.

Invalid input will throw a TypeError.

EthereumAddress - from()

The static from class method is able to construct an EthereumAddress from strings or BSON Binary objects.

It will either return a new instance of an EthereumAddress or null if conversion was not possible.

EthereumAddress - toString()

This method will return a hexadecimal string representation of the address.

EthereumAddress - toBuffer()

This method will return a Buffer containing the address.

EthereumAddress - toBinary()

This method will return a BSON Binary containing the address.

Keywords

FAQs

Package last updated on 15 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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