Verify Mask

This commit is contained in:
Anatoly Prohacky 2023-03-11 18:06:30 +10:00
parent c584f650fa
commit 1c01e2dc29
2 changed files with 11 additions and 0 deletions

View File

@ -60,6 +60,15 @@ func (a AclBit) Verify(n NumBit) bool {
return false
}
// verify mask return true or false
func (a AclBit) VerifyMask(mask AclBit) bool {
if (a & mask) > 0 {
return true
}
return false
}
// verify or bit return true or false
func (a AclBit) VerifyOr(n ...NumBit) bool {
for _, n0 := range n {

View File

@ -50,4 +50,6 @@ func main() {
}
fmt.Println(ret)
fmt.Println(acl.AllBit)
fmt.Println(16 & 32)
}