Refactor, improved readability
This commit is contained in:
14
util.cpp
Normal file
14
util.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Created by Andrew on 01/06/2023.
|
||||
//
|
||||
|
||||
#include "header.h"
|
||||
|
||||
/* Convert data between endianness types. */
|
||||
void endian(byte *data, int length) {
|
||||
for (int i = 0; i < length / 2; i++) {
|
||||
byte temp = data[i];
|
||||
data[i] = data[length - i - 1];
|
||||
data[length - i - 1] = temp;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user