OpenMetaverse.Helpers.InventoryCRC C# (CSharp) Method

InventoryCRC() public static method

Calculates the CRC (cyclic redundancy check) needed to upload inventory.
public static InventoryCRC ( int creationDate, byte saleType, sbyte invType, sbyte type, UUID assetID, UUID groupID, int salePrice, UUID ownerID, UUID creatorID, UUID itemID, UUID folderID, uint everyoneMask, uint flags, uint nextOwnerMask, uint groupMask, uint ownerMask ) : uint
creationDate int Creation date
saleType byte Sale type
invType sbyte Inventory type
type sbyte Type
assetID UUID Asset ID
groupID UUID Group ID
salePrice int Sale price
ownerID UUID Owner ID
creatorID UUID Creator ID
itemID UUID Item ID
folderID UUID Folder ID
everyoneMask uint Everyone mask (permissions)
flags uint Flags
nextOwnerMask uint Next owner mask (permissions)
groupMask uint Group mask (permissions)
ownerMask uint Owner mask (permisions)
return uint
        public static uint InventoryCRC(int creationDate, byte saleType, sbyte invType, sbyte type,
            UUID assetID, UUID groupID, int salePrice, UUID ownerID, UUID creatorID,
            UUID itemID, UUID folderID, uint everyoneMask, uint flags, uint nextOwnerMask,
            uint groupMask, uint ownerMask)
        {
            uint CRC = 0;

            // IDs
            CRC += assetID.CRC(); // AssetID
            CRC += folderID.CRC(); // FolderID
            CRC += itemID.CRC(); // ItemID

            // Permission stuff
            CRC += creatorID.CRC(); // CreatorID
            CRC += ownerID.CRC(); // OwnerID
            CRC += groupID.CRC(); // GroupID

            // CRC += another 4 words which always seem to be zero -- unclear if this is a UUID or what
            CRC += ownerMask;
            CRC += nextOwnerMask;
            CRC += everyoneMask;
            CRC += groupMask;

            // The rest of the CRC fields
            CRC += flags; // Flags
            CRC += (uint)invType; // InvType
            CRC += (uint)type; // Type
            CRC += (uint)creationDate; // CreationDate
            CRC += (uint)salePrice;    // SalePrice
            CRC += (uint)((uint)saleType * 0x07073096); // SaleType

            return CRC;
        }