Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@ethersproject/address
Advanced tools
@ethersproject/address is a part of the ethers.js library, which provides utilities for handling Ethereum addresses. It includes functions for address validation, checksum address generation, and address formatting.
Address Validation
This feature allows you to check if a given string is a valid Ethereum address.
const { isAddress } = require('@ethersproject/address');
const address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e';
console.log(isAddress(address)); // true
Checksum Address Generation
This feature converts an Ethereum address to its checksummed version, which includes mixed-case letters to help prevent errors.
const { getAddress } = require('@ethersproject/address');
const address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e';
const checksumAddress = getAddress(address);
console.log(checksumAddress); // '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
Address Formatting
This feature formats an Ethereum address to its canonical form, ensuring consistency in address representation.
const { getAddress } = require('@ethersproject/address');
const address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e';
const formattedAddress = getAddress(address);
console.log(formattedAddress); // '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
web3-utils is a utility library that is part of the web3.js library. It provides similar functionalities for Ethereum address validation and formatting. Compared to @ethersproject/address, web3-utils is part of a larger library that includes many other utilities for interacting with the Ethereum blockchain.
ethereumjs-util is a collection of utility functions for Ethereum, including address validation and checksum generation. It is a lower-level library compared to @ethersproject/address and provides more granular control over Ethereum-related operations.
This sub-module is part of the ethers project.
It is responsible for encoding, verifying and computing checksums for Ethereum addresses and computing special addresses, such as those enerated by and for contracts under various situations.
For more information, see the documentation.
Most users will prefer to use the umbrella package, but for those with more specific needs, individual components can be imported.
const {
getAddress,
isAddress,
getIcapAddress,
getContractAddress,
getCreate2Address
} = require("@ethersproject/address");
MIT License
FAQs
Utilities for handling Ethereum Addresses for ethers.
The npm package @ethersproject/address receives a total of 925,252 weekly downloads. As such, @ethersproject/address popularity was classified as popular.
We found that @ethersproject/address demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.