Documentation
¶
Overview ¶
Package checksum implements the FITS checksum algorithm defined in Appendix J of the FITS Standard v4.0.
The FITS checksum is a 32-bit 1's-complement sum computed over the big-endian uint16 view of an HDU's 2880-byte-aligned bytes. Overflow bits are folded back into the low 16 bits so that every bit position is sampled evenly. The final 32-bit value is ASCII-encoded via Rob Seaman's encoding so that the CHECKSUM keyword value is printable and round-trippable.
Port of cfitsio checksum.c (ffcsum / ffesum / ffdsum). Algorithm verbatim, idioms Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compute ¶
Compute returns the 32-bit 1's-complement checksum of the supplied bytes. The length must be a multiple of 4 (i.e. the caller has already padded the input to the block boundary as FITS requires).
func Decode ¶
Decode is the inverse of Encode. It returns the 32-bit checksum sum that produced the given 16-character ASCII encoding.
Types ¶
This section is empty.