Set permissions in binary

前端 未结 5 1990
说谎
说谎 2020-12-29 16:06

I saw in school a system that set permissions using binary string.

Let\'s say 101001 = 41

So :

  • 1 can be permission to page 1
  • 2 can b
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 16:38

    Since it's binary & decimal you can convert it back & forth with decbin and bindec. It's just a different base to count with...

    EDIT: bitwise is sweet, do that ^_^

提交回复
热议问题