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

ethereum-checksum-address

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereum-checksum-address - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

16

index.js

@@ -8,3 +8,5 @@ const keccak256 = require('keccak256')

if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) { throw new Error(`Given address "${address}" is not a valid Ethereum address.`) }
if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {
throw new Error(`Given address "${address}" is not a valid Ethereum address.`)
}

@@ -18,3 +20,5 @@ const stripAddress = stripHexPrefix(address).toLowerCase()

for (let i = 0; i < stripAddress.length; i++) { checksumAddress += parseInt(keccakHash[i], 16) >= 8 ? stripAddress[i].toUpperCase() : stripAddress[i] }
for (let i = 0; i < stripAddress.length; i++) {
checksumAddress += parseInt(keccakHash[i], 16) >= 8 ? stripAddress[i].toUpperCase() : stripAddress[i]
}

@@ -38,7 +42,7 @@ return checksumAddress

return true
};
}
function stripHexPrefix (string) {
return string.slice(0, 2) === '0x' ? string.slice(2) : string
};
function stripHexPrefix (value) {
return value.slice(0, 2) === '0x' ? value.slice(2) : value
}

@@ -45,0 +49,0 @@ module.exports = {

{
"name": "ethereum-checksum-address",
"version": "0.0.2",
"version": "0.0.3",
"description": "Convert Ethereum address to a checksummed address",

@@ -5,0 +5,0 @@ "main": "index.js",

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