0

I'm working on a function to generate QR codes in vba. I'm following this tutorial. I am now working on generating the error correction words in this step. This requires GF(256) log/antilog tables, seen here. I really don't want to have to type in the whole table. Does anyone know the function used to generate these tables so I can just store them in arrays? The tutorial had a link to how the tables were generated but it was broken.

I should have mentioned it earlier, but this will be run in access, so pasting into excel won't work very well. But as I'm writing this I'm realizing I could use an access table. Though I would prefer to just do it all in code.

Erik A
  • 31,639
  • 12
  • 42
  • 67
DasPete
  • 831
  • 2
  • 18
  • 37

1 Answers1

0
Const GF = 256 '// define the Size & Prime Polynomial of this Galois field
Const PP = 285
Dim logg(GF)  'establish global Log and Antilog arrays
Dim alogg(GF)


'fill the logg() and alogg() arrays with appropriate integer values

logg(0) = 1
alogg(0) = 1

For i = 1 To 255
  alogg(i) = alogg(i - 1) * 2
  If alogg(i) >= GF Then alogg(i) = alogg(i) Xor PP
  logg(alogg(i)) = i
Next i