Last active
February 26, 2021 10:52
-
-
Save NeoTech/58a1b1d8f1501e73185ccb5b4e605d73 to your computer and use it in GitHub Desktop.
Access mask.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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