Skip to content

Instantly share code, notes, and snippets.

@NeoTech
Last active February 26, 2021 10:52
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 NeoTech/58a1b1d8f1501e73185ccb5b4e605d73 to your computer and use it in GitHub Desktop.
Save NeoTech/58a1b1d8f1501e73185ccb5b4e605d73 to your computer and use it in GitHub Desktop.
Access mask.
// Defines the stored mask value.
var mask = 194;
// Returns a array of reversed bit orders.
var a = parseInt(mask,10).toString(2).split('').reverse();
console.log(a);
// Encodes the bitorder back into a stored mask value.
var x = parseInt(a.reverse().join('').toString(), 2);
console.log(x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment