akalongman / sublimetext-stringutilities

Sublime Text 2/3 plugin for string manipulations
MIT License
83 stars 24 forks source link

Add decoding HeidiSQL passwords #15

Closed akalongman closed 6 years ago

akalongman commented 8 years ago

Function on js

function heidiDecode(hex) {
    var str = '';
    var shift = parseInt(hex.substr(-1));
    hex = hex.substr(0, hex.length - 1);
    for (var i = 0; i < hex.length; i += 2)
      str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
    return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));