From 1c01e2dc29e61f5ffc9b7b23990c108ad2fcae49 Mon Sep 17 00:00:00 2001 From: Anatoly Prohacky Date: Sat, 11 Mar 2023 18:06:30 +1000 Subject: [PATCH] Verify Mask --- acl/aclbit.go | 9 +++++++++ main.go | 2 ++ 2 files changed, 11 insertions(+) diff --git a/acl/aclbit.go b/acl/aclbit.go index 1366a50..9646b0a 100644 --- a/acl/aclbit.go +++ b/acl/aclbit.go @@ -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 { diff --git a/main.go b/main.go index a38b3e5..51e5275 100644 --- a/main.go +++ b/main.go @@ -50,4 +50,6 @@ func main() { } fmt.Println(ret) fmt.Println(acl.AllBit) + + fmt.Println(16 & 32) }