libSPEC
Pokemon Save Editing Library
|
Containes functions for calculation of checksums. More...
#include <stdlib.h>
#include <stdint.h>
Functions | |
uint16_t | nds_crc16 (const uint8_t *, size_t) |
Calculates the CRC-16-IBM of the given data. More... | |
uint16_t | gba_block_checksum (const uint8_t *, size_t) |
Calculates a 16-bit block checksum of the given data. More... | |
uint8_t | gb_rby_checksum (const uint8_t *, size_t) |
Calculates the 8-bit GB block checksum of the given data. More... | |
uint16_t | gb_gsc_checksum (const uint8_t *, size_t) |
Calculates the 16-bit GB block checksum of the given data. More... | |
uint16_t | pkm_checksum (const uint8_t *, size_t) |
Calculates a simple 16-bit checksum of the given data. More... | |
uint16_t | pk3_checksum (const uint8_t *, size_t) |
Calculates a simple 16-bit checksum of the given data. More... | |
Containes functions for calculation of checksums.
uint16_t nds_crc16 | ( | const uint8_t * | ptr, |
size_t | size | ||
) |
Calculates the CRC-16-IBM of the given data.
This is used by NDS saves for calculating block checksums.
ptr | The pointer to the start of the data. |
size | The length of the data. |
uint16_t gba_block_checksum | ( | const uint8_t * | ptr, |
size_t | size | ||
) |
Calculates a 16-bit block checksum of the given data.
This is used by the GBA to calculate block checksums.
ptr | The pointer to the start of the data. |
size | The length of the data. |
uint8_t gb_rby_checksum | ( | const uint8_t * | ptr, |
size_t | size | ||
) |
Calculates the 8-bit GB block checksum of the given data.
This is used by Pokemon Red, Blue, and Yellow to calculate block checksums.
ptr | The pointer to the start of the data. |
size | The length of the data. |
uint16_t gb_gsc_checksum | ( | const uint8_t * | ptr, |
size_t | size | ||
) |
Calculates the 16-bit GB block checksum of the given data.
This is used by Pokemon Gold, Silver, and Crystal to calculate block checksums.
ptr | The pointer to the start of the data. |
size | The length of the data. |
uint16_t pkm_checksum | ( | const uint8_t * | ptr, |
size_t | size | ||
) |
Calculates a simple 16-bit checksum of the given data.
This is used in the PKM data structures to calculate the checksum of the encrypted blocks.
ptr | The pointer to the start of the data. |
size | The length of the data. |
uint16_t pk3_checksum | ( | const uint8_t * | ptr, |
size_t | size | ||
) |
Calculates a simple 16-bit checksum of the given data.
This is simply a copy of pkm_checksum(), it is used in the PK3 data structures to calculate the checksum of the encrypted blocks.
ptr | The pointer to the start of the data. |
size | The length of the data. |