Skip to content

Instantly share code, notes, and snippets.

@lukashavrlant
Created November 5, 2012 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukashavrlant/4018437 to your computer and use it in GitHub Desktop.
Save lukashavrlant/4018437 to your computer and use it in GitHub Desktop.
function strID2intID($stringID) {
return (ord($stringID[0]) << 8) + ord($stringID[1]);
}
function intID2strID($intID) {
return chr($intID >> 8) . chr($intID % 256);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment