Martijn Braam on Nostr: Is there just no good resource on putting data in a uint8_t[] buffer and getting it ...
Is there just no good resource on putting data in a uint8_t[] buffer and getting it out again in a correct way in c++? Putting in a string or an unsigned number is easy but annoyingly verbose. Using a struct to represent the buffer seems to work great but is adviced against with packing and compatability :(
Published at
2023-09-26 14:37:28Event JSON
{
"id": "d5e792666ed15e3e76b190e22c9ceceb17b79e0e61ac78540af06d792e794c4c",
"pubkey": "579852afc54f2f4b992d5c48441d63f6545c530a7371764b6e67325d585ea6a1",
"created_at": 1695739048,
"kind": 1,
"tags": [
[
"proxy",
"https://fosstodon.org/users/martijnbraam/statuses/111131954266648901",
"activitypub"
]
],
"content": "Is there just no good resource on putting data in a uint8_t[] buffer and getting it out again in a correct way in c++? Putting in a string or an unsigned number is easy but annoyingly verbose. Using a struct to represent the buffer seems to work great but is adviced against with packing and compatability :(",
"sig": "c0f5808d168fc3a1876ad56e89af4a63e1fb5a17b09673706aec198892b94592f90df0fbac89bc49b2841bd95f1084ef4fc2426f8943052acb99bf082d219f5b"
}