title: Constructing a Method ID on Solidity
body: <p>Good Afternoon Everybody! Based off the example on <a href="https://docs.soliditylang.org/en/develop/abi-spec.html#examples" rel="nofollow noreferrer">the official website.</a> The example they provided was:</p>
  <pre><code>// SPDX-License-Identifier: GPL-3.0
  pragma solidity &gt;=0.4.16 &lt;0.9.0;
  
  contract Foo {
      function bar(bytes3[2] memory) public pure {}
      function baz(uint32 x, bool y) public pure returns (bool r) { r = x &gt; 32 || y; }
      function sam(bytes memory, bool, uint[] memory) public pure {}
  }
  </code></pre>
  <p>In Following the example; I Understand to take the method name along with the parameters in its ASCII form and you should be able to produce <code>0xcdcd77c0</code>(After taking its first 4 Bytes)</p>
  <p>So in my quest to understand the process so that I may recreate it programmatically, I found an online <a href="https://emn178.github.io/online-tools/keccak_256.html" rel="nofollow noreferrer">Keccak-256 Converter</a> and it produced:</p>
  <pre><code>cdcd77c0992ec5bbfc459984220f8c45084cc24d9b6efed1fae540db8de801d2
  </code></pre>
  <p>From My understanding the first 4 Bytes should be <code>cdcd </code> and that is not correct. So then I found myself down a rabbit hole and attempted to do a text &gt; ASCII &gt; Keccak Signature and that still did not produce what I needed.. So I am asking the community to help me understand how 4 bytes have turned into 10 characters.... Please and thank you.</p>