From 07f03e70e19f28ffac4bd8bf1c3353329592ace7 Mon Sep 17 00:00:00 2001 From: Anatoly Prohacky Date: Sun, 12 Mar 2023 15:48:43 +1000 Subject: [PATCH] Parsing Acl to Numbit --- acl/aclbit.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/acl/aclbit.go b/acl/aclbit.go index 9646b0a..0faa7ea 100644 --- a/acl/aclbit.go +++ b/acl/aclbit.go @@ -69,6 +69,17 @@ func (a AclBit) VerifyMask(mask AclBit) bool { return false } +// parsing AlcBit to array NumBit +func (a AclBit) Parse() []NumBit { + var n []NumBit + for i := 0; i < 63; i++ { + if a.Verify(NumBit(i)) { + n = append(n, NumBit(i)) + } + } + return n +} + // verify or bit return true or false func (a AclBit) VerifyOr(n ...NumBit) bool { for _, n0 := range n {