I have a weird problem. Suppose there is a 8-bit string to represent privilege of some process. I have 4 type of privileges A,B,C,D. Under each category, there might be sub privileges as well. How to represent it in just 8 bits?
Asked
Active
Viewed 49 times
-1
-
Too vague. Are the privileges disjunct or can they be combined? How many of the subprivileges are there? Does having a subprivilege imply having a privilege, or vice versa? Can subprivileges have subprivileges? And most importantly, how many subprivileges are there? (Important enough to ask twice.) – Amadan Dec 13 '12 at 04:22
-
yes they are disjucntive and as for the number of sub privileges, it can vary and subprivileges can have nested subprivileges – Sudipta Roy Dec 13 '12 at 04:38
1 Answers
0
If they are disjunct, just give each privilege its own unique ID, and hope they never grow beyond 256. Use a lookup table to know what's what, and what supercategories they have.

Amadan
- 191,408
- 23
- 240
- 301