title: CryptoJS cannot compare with pre-hashed data
body: <p>i have a password table which containes SHA1 hashed data. so i want to make a validation input with CryptoJS. it went error.. but when i try to display it, the result matched.. did i code a wrong function? </p>
  
  <p>here's my code</p>
  
  <pre><code>function checkCurPass()
  {
      var hash = CryptoJS.SHA1("&lt;?php echo $selected-&gt;password ?&gt;");
      var currentPass = document.getElementById('users-profile-currentpassword');
      var hashedPass = CryptoJS.SHA1(currentPass.value);
  
      var message = document.getElementById('mesas');
      message.innerHTML = hashedPass;
  
      if (hashedPass == hash) 
      {
          $('#currentPassForm').addClass('has-success').removeClass('has-error');
      }
      else
      {
          $('#currentPassForm').addClass('has-error').removeClass('has-success');
      }
  }
  </code></pre>
  
  <p>screenshot with hashed 'default'</p>
  
  <p><img src="https://i.stack.imgur.com/KRoBd.jpg" alt="enter image description here"></p>