lib/helper.c
uint8_t *array_byteswap(uint8_t *buffer, size_t length)
{
	size_t i;
	uint8_t temp;
	size_t max = length - 1;

	for (i = 0; i < length / 2; ++i) {
		temp = buffer[i];
		buffer[i] = buffer[max - i];
		buffer[max - i] = temp;
	}

	return buffer;
}
/*
 * Unconditionally reverse the order of arbitrarily long strings of bytes
 */
Unconditionally reverse the order of arbitrarily long strings of bytes
Unconditionally reverse the order of arbitrarily long strings of bytes
uint8_t *array_byteswap(uint8_t *buffer, size_t length)
{
	size_t i;
	uint8_t temp;
	size_t max = length - 1;
	for (i = 0; i < length / 2; ++i) {
		temp = buffer[i];
		buffer[i] = buffer[max - i];
		buffer[max - i] = temp;
	}
	return buffer;
}
uint8_t * array_byteswap ( uint8_t * buffer , size_t length ) { size_t i ; uint8_t temp ; size_t max = length - 1 ; for ( i = 0 ; i < length / 2 ; ++ i ) { temp = buffer [ i ] ; buffer [ i ] = buffer [ max - i ] ; buffer [ max - i ] = temp ; } return buffer ; }
Unconditionally reverse the order of arbitrarily long strings of bytes
Unconditionally reverse the order of arbitrarily long strings of bytes