     
     public init?(data: Data) {
         
-        guard let length = Length(rawValue: data.count)
+        guard let length = DataLength(rawValue: data.count)
             else { return nil }
         
         guard let beaconType = GAPBeaconType(rawValue: data[0]),

    
    var data: Data {
        
        var data = Data()
        
        data.append(type(of: self).beaconType.rawValue)
        
        data.append(UInt128(uuid: deviceUUID).littleEndian.data)
        
        let flagsBytes = oobInformationFlags.rawValue.littleEndian.bytes
        data += [flagsBytes.0, flagsBytes.1]
        
        if let uriBytes = uriHash?.littleEndian.bytes {
            data += [uriBytes.0, uriBytes.1, uriBytes.2, uriBytes.3]
        }
        
        return data
    }
    
    enum Length: Int {
        
        case withoutURI = 19
        case withURI = 23
    }
}


        
        let uriHash: UInt32?
        
        if length.uriHash {
            
            uriHash = UInt32(littleEndian: UInt32(bytes: (data[19], data[20], data[21], data[22])))
            
        } else {
            
            uriHash = nil
        }
        
        self.init(deviceUUID: deviceUUID, oobInformationFlags: oobInformationFlags, uriHash: uriHash)
