// Generated by CoffeeScript 2.0.2
var doGenerate;

window.onload = function () {
  $("#loader_overlay").hide();
  $("#generateButton").on("click", doGenerate);
  $("#input").on("change", doGenerate);
  $("#input").on("keyup", doGenerate);
  return $("#generator").on("change", doGenerate);
};

doGenerate = function doGenerate() {
  var generator, input, result;
  input = $("#input").val();
  generator = $("#generator").val();
  console.log("Generator: " + generator);
  result = function () {
    switch (generator) {
      case "md5":
        return CryptoJS.MD5(input).toString();
      case "sha1":
        return CryptoJS.SHA1(input).toString();
      case "sha256":
        return CryptoJS.SHA256(input).toString();
      case "sha512":
        return CryptoJS.SHA512(input).toString();
      default:
        return null;
    }
  }();
  $("#output").val(result);
  return false;
};
