Skip to content

Instantly share code, notes, and snippets.

@trevorbicewebdesign
Forked from jpatters/HeidiDecode.js
Last active October 4, 2022 12:06
Show Gist options
  • Save trevorbicewebdesign/6b747ba8e00a2e9f8001 to your computer and use it in GitHub Desktop.
Save trevorbicewebdesign/6b747ba8e00a2e9f8001 to your computer and use it in GitHub Desktop.
function decodeHeidisql($hex) {
$string = '';
$shift = substr($hex, -1, 1);
$hex = substr($hex, 0, -1);
for($i=0;$i<strlen($hex); $i += 2) {
$string .= chr(intval(substr($hex, $i, 2), 16)-$shift);
}
return $string;
}
echo decodeHeidisql('755A5A585C3D8141786B3C385E3A393');
@trevorbicewebdesign
Copy link
Author

Here is a PHP version some people may find handy.
http://webdesign.trevorbice.com/

@DRSDavidSoft
Copy link

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment