code: function elv2hex(val) {
      let i = 0;
      let ret = '';
      while (i < val.length) {
          let ch = val.substr(i, 1);
          if (ch === ' ') {
              i += 1;
          } else {
              let cl = val.substr(i + 1, 1);
              if (!(ch > 0 && ch < 5)) {
                  return false;
              }
              if (cl === '') {
                  cl = 1;
              }
              if (!(cl > 0 && cl < 5)) {
                  return false;
              }
              ch -= 1;
              cl -= 1;
              const r = (ch << 2) + cl;
              ret += r.toString(16).toUpperCase();
              i += 2;
          }
      }
      return ret;
  }
docs: Elv2hex() by Uwe Langhammer