Skip to content

Instantly share code, notes, and snippets.

@JWLangford
Last active December 2, 2021 05:22
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 JWLangford/8f00a5d6ed3b7e120a37b929647184c0 to your computer and use it in GitHub Desktop.
Save JWLangford/8f00a5d6ed3b7e120a37b929647184c0 to your computer and use it in GitHub Desktop.
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