Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active December 6, 2019 21:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/20fcd7c5c2604907dcbba749ea3f1e8c to your computer and use it in GitHub Desktop.
Save miguelmota/20fcd7c5c2604907dcbba749ea3f1e8c to your computer and use it in GitHub Desktop.
Node.js check if valid ethereum private key
var ethUtil = require('ethereumjs-util')
var key = 'a3d49d0f53da61605eb44f44...'
if (ethUtil.isValidPrivate(key)) {
// valid
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment