Skip to content

Instantly share code, notes, and snippets.

@said-and-done
Created October 2, 2017 12:21
Show Gist options
  • Save said-and-done/4c345b095844b5ebfa2ec8762ab11103 to your computer and use it in GitHub Desktop.
Save said-and-done/4c345b095844b5ebfa2ec8762ab11103 to your computer and use it in GitHub Desktop.
Google spreadsheets - gid to worksheet id
var gid2Wid = function (gid) {
var xorval = gid > 31578 ? 474 : 31578;
var letter = gid > 31578 ? 'o' : '';
return letter + parseInt((gid ^ xorval)).toString(36);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment