Code Monkey home page Code Monkey logo

keccak256-cli's Introduction

keccak256-cli

keccak256 encryption cli program; accepts input text from stdin. Suitable for commandline users.

It is the same algorithm used to encode method signature to get method id as shown on those blockchain scans e.g. etherscan.com, bscscan.com, or polygonscan.com

Installation

cargo install keccak256-cli

Usage

  1. Normal with no arguments
$ echo "approve(address,uint256)" | keccak256
0x095ea7b334ae44009aa867bfb386f5c3b4b443ac6f0ee573fa91c4608fbadfba
  1. With --method-id flag to output as method id; suitable for method signature
$ echo "approve(address,uint256)" | keccak256 --method-id
0x095ea7b3
  1. Additional with --no-0x flag to avoid prefixed 0x
$ echo "approve(address,uint256)" | keccak256 --method-id --no-0x
095ea7b3
  1. Encode content of input file with various flags
$ cat myfile.txt
line1
line2
line3

$ cat myfile.txt | keccak256
0xf500641328ecab72baae3555278fc470860a4a243e62e9534120d8405def6143

$ cat myfile.txt | keccak256 --each-line
0x231e770f96ffa24e1fec6b52fd47915ab8c491356d1d02de165a5bf6f3d72280
0x12221da17783f65564f9fab0b1bc89c5c556b4268b4c98279ead6beb6fd86ceb
0x8bb5ab46551d22e650ad150d9cefef6ab6e65e0a2ae3a71c47c645a777314f19

$ cat myfile.txt | keccak256 --each-line --no-0x --method-id
231e770f
12221da1
8bb5ab46

License

MIT, Wasin Thonkaew

keccak256-cli's People

Contributors

haxpor avatar

Stargazers

 avatar

Watchers

 avatar  avatar

keccak256-cli's Issues

keccak256-cli not working

I installed keccak256-cli with the command cargo install keccak256-cli then I received a warning

warning: be sure to add `/root/.cargo/bin` to your PATH to be able to run the installed binaries

So i cd into the directory (/root/.cargo/bin) and found keccak256 writing in red.
Screenshot_20230606-183556

I then try running the command echo "approve(address,uint256)" | keccak256

Output
keccak256: command not found

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.