Hey guys I'd like to know how to encode a 32 integer array as similar to the python function below? Below is the python code:
def encodePublicKey(key, key_type):
return b"\x42" + key + b"\x13\x37" + key_type.encode("US-ASCII")
Below is the C code that I have written ( I do believe there are some errors)
#include<stdio.h>
uint8_t value[33] =
{
0xED, 0xD3, 0xF5, 0x5C, 0x1A, 0x63, 0x12, 0x58,
0xD6, 0x9C, 0xF7, 0xA2, 0xDE, 0xF9, 0xDE, 0x14,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
0x00,
};
void Encode(uint8_t *value) {
}
int main(){
uint8_t value[33];
Encode(&value);
}
I'd like to know how to encode and decode the byte array. Thanks.