title: Mysql/Phpmyadmin hex ASCII/BINARY
body: <p>I am trying to transform a value that is in char(20) into hex varchar(40).</p>
  
  <p>The value is </p>
  
  <blockquote>
    <p>_ÆúÛlw¦™‹Q|Ý­"9Õ</p>
  </blockquote>
  
  <p>After i used hex on it it gave me 40char list</p>
  
  <blockquote>
    <p><strong>5FC386C3BAC39B6C77C2A6E284A2E280B9510C7C</strong></p>
  </blockquote>
  
  <p>But from what i've researched the conversion was not good. The actual hex should've been </p>
  
  <blockquote>
    <p><em>5FC6FADB6C77A6998B510C7CDD0419AD221A39D5</em></p>
  </blockquote>
  
  <p>Question is why the hex process didn't go as planned if all things were in place and used ?</p>
  
  <p>I used phpmyadmin for this. And the command used was </p>
  
  <pre><code>UPDATE tablename SET col2name =hex(col1name);
  </code></pre>
  
  <p>col2name = varchar(40)</p>
  
  <p>col1name = char(20)</p>
  
  <p>p.s I've taken that first value to some decrypt site and used ASCII to HEX and it converted with the good value.</p>