One embodiment relates to a method of generating an N-bit checksum for variable-length data. An N-bit data word of the variable-length data is received by data input circuitry, and an N-bit input checksum generator is used to calculate an updated value of the N-bit checksum for N-bit data words. A plurality of smaller checksum generators and the N-bit input checksum generator are each used to calculate a last value of the N-bit checksum for the last data word of the variable-length data. Control signals are used to controllably select the last value of the N-bit checksum from outputs of said checksum generators. Other embodiments and features are also disclosed.