I have a checksum256
type, I want to reach its specific elements as an integer.
Ex
cheksum256 myvar = 3dd6a4a0c86763d2a6fc1d5544eb58f3953b7cd03882e700b420fa0a89129f66;
I want myvar[0]
and myvar[2]
as an int
type.
EOS.IO Stack Exchange is a question and answer site for users and developers of distributed applications built on top of the blockchain operating system, EOS.IO. It only takes a minute to sign up.
Sign up to join this communityNot sure if i get the question right, probably something like this is what you looking for.
auto checksumBytes = myvar.extract_as_byte_array().data();
uint64_t num1, num2;
memcpy(&num1, &checksumBytes[0], sizeof(num1));
memcpy(&num2, &checksumBytes[7], sizeof(num2));