Parsing Acl to Numbit

This commit is contained in:
Anatoly Prohacky 2023-03-12 15:48:43 +10:00
parent 1c01e2dc29
commit 07f03e70e1

View File

@ -69,6 +69,17 @@ func (a AclBit) VerifyMask(mask AclBit) bool {
return false 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 // verify or bit return true or false
func (a AclBit) VerifyOr(n ...NumBit) bool { func (a AclBit) VerifyOr(n ...NumBit) bool {
for _, n0 := range n { for _, n0 := range n {