title: How to verify digital signature with public key?
body: <p>I am doing a project about Cryptocurrency. I am given a pair of public key and private key for one user. 
  Here is how I sign my data:</p>
  
  <pre><code>sig = this.hash(trans.details +trans.privKey);
  </code></pre>
  
  <p>The hash function is provided.
  My question is how to verify this signature with a given public key?</p>
  
  <p>I have tried this</p>
  
  <pre><code>var v = this.hash(trans.details+"");
  </code></pre>
  
  <p>:<code>var v2=this.hash(sig+trans.pubKey);</code>
  I compared these two hash value, they are not the same. 
  For my understanding, there is a way to have these match each other so that I could say the signature is valid.</p>
  
  <p>Note: Public key and Private key are given in this project. So they should be correct.</p>
  
  <p>What am I missing? Any ideas?</p>