You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: errorcorrection.go
    path of file: ./repos/awless/vendor/github.com/boombuler/barcode/pdf417
    
    the code of the file until where you have to start completion: package pdf417

type securitylevel byte

func (level securitylevel) ErrorCorrectionWordCount() int {
	return 1 << (uint(level) + 1)
}

var correctionFactors = [][]int{
	// Level 0
	[]int{27, 917},

	// Level 1
	[]int{522, 568, 723, 809},

	// Level 2
	[]int{237, 308, 436, 284, 646, 653, 428, 379},

	// Level 3
	[]int{
		274, 562, 232, 755, 599, 524, 801, 132, 295, 116, 442, 428, 295, 42,
		176, 65,
	},

	// Level 4
	[]int{
		361, 575, 922, 525, 176, 586, 640, 321, 536, 742, 677, 742, 687,
		284, 193, 517, 273, 494, 263, 147, 593, 800,
    
func (level securitylevel) Compute(data []int) []int {
	// Correction factors for the given level
	factors := correctionFactors[int(level)]

	// Number of correction code words
	count := level.ErrorCorrectionWordCount()

	// Correction code words array, prepopulated with zeros
	ecWords := make([]int, count)

	for _, value := range data {
		temp := (value + ecWords[0]) % 929

		for i := count - 1; i >= 0; i-- {
			add := 0

			if i > 0 {
				add = ecWords[count-i]
			}

			ecWords[count-1-i] = (add + 929 - (temp*factors[i])%929) % 929
		}
	}

	for key, word := range ecWords {
		if word > 0 {
			ecWords[key] = 929 - word
		}
	}

	return ecWords
}