Giter VIP home page Giter VIP logo

keycheck's Introduction

Keycheck

Checks your repository for Ethereum private keys in the hexadecimal format. Meant to be used in a pre-commit hook.

Installation

cargo install keycheck

Usage

Manual

Check the current folder and all subfolders for private keys. Respects your .gitignore
Upon finding a private key, outputs the file and line number, but not the key itself. Exit code 0 for no keys, 1 for key(s) found.

keycheck

In a git pre-commit hook

brew install lefthook

echo 'pre-commit:
  commands:
    keycheck:
      run: keycheck' > lefthook.yml
      
lefthook install

Ignoring files

keycheck respects a .keycheckignore file. Format is the same as .gitignore, so globs, comments etc. work as expected.

Performance

on OpenZeppelin/openzeppelin-contracts repo:

$ hyperfine keycheck -i --warmup 5
Benchmark 1: keycheck
  Time (mean ± σ):      13.1 ms ±   0.5 ms    [User: 3.6 ms, System: 15.9 ms]
  Range (min … max):    12.4 ms …  15.2 ms    183 runs

priv-key-precommit

hyperfine priv-key-precommit --warmup 5
Benchmark 1: priv-key-precommit
Time (mean ± σ):      1.651 s ±  0.047 s    [User: 1.625 s, System: 0.217 s]
Range (min … max):    1.599 s …  1.746 s    10 runs

keycheck is 126x times faster, or a 99.2% performance improvement.

License

MIT

keycheck's People

Contributors

vacekj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.