Last active
December 2, 2021 05:22
-
-
Save JWLangford/8f00a5d6ed3b7e120a37b929647184c0 to your computer and use it in GitHub Desktop.
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
interface IUser { | |
status Status | |
...other user stuff | |
} | |
enum Status { | |
NO_STATUS = 0, | |
ACTIVE = 1, // 2^0 | |
ADMIN = 2, // 2^1 | |
EMAIL_VERIFIED = 4, // 2^2 | |
PAYMENT_VERIFIED = 8, // 2^3 | |
TFA_ENABLED = 16, // 2^4 | |
} | |
// Alternative with Hexadecimal values | |
enum Status { | |
NO_STATUS = 0X0, | |
ACTIVE = 0X1, // 2^0 | |
ADMIN = 0X2, // 2^1 | |
EMAIL_VERIFIED = 0X4, // 2^2 | |
PAYMENT_VERIFIED = 0X8, // 2^3 | |
TFA_ENABLED = 0X10, // 2^4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment