From bcd16c93b163737788813a742704c4b710cc3cbe Mon Sep 17 00:00:00 2001 From: Gary Belvin Date: Thu, 4 Mar 2021 16:14:46 +0000 Subject: [PATCH] CapabilityPrimitive --- commands/types.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/types.go b/commands/types.go index e218aea..9194da1 100644 --- a/commands/types.go +++ b/commands/types.go @@ -165,3 +165,12 @@ const ( ListObjectParamID uint8 = 0x01 ListObjectParamType uint8 = 0x02 ) + +// CapabilityPrimitiveFromSlice OR's all the capabilitites together. +func CapabilityPrimitiveFromSlice(capabilitites []uint64) uint64 { + var primitive uint64 + for _, c := range capabilitites { + primitive |= c + } + return primitive +}