title: How do number based permission systems work?
body: <p><strong>This is NOT a question about Discord, but about how a feature on Discord was implemented.</strong></p>
  <p>Discord has a system in place where a set of numbers added together can represent a set of selected permissions. I spent some time looking around the internet and playing with Discord's link generator to form an understanding of what is happening but I haven't been successful.</p>
  <p>In the following image, it can be seen that I have selected a set of permissions for a small bot and in the generated URL a number is provided under the permissions parameter:
  <a href="https://i.stack.imgur.com/J0Nnw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J0Nnw.png" alt="Permissions" /></a></p>
  <p>What I don't understand is, how are the numbers (for each permission) assigned such that when any combination of numbers is added together there are no conflicting/ambiguous results?</p>
  <p>Also, once a number is generated, how are the numbers interpreted and converted back to their original meanings?</p>