I am new in soroban. so pardon me if I am asking something wrong.
I have a struct that I need to serialize and creat a hash out of it. Here is how struct looks like
pub struct Message {
version: u8,
nonce: u32,
sender: Address,
recipient: Address,
body: Bytes,
}
Now I am planning to create a ID for any message using these fields. So my idea is to serialize the struct and then create a hash out of it.
Is there any way to do it ? Or am I thinking in wrong way ?
Is there any better way to generate message id that is always deterministic based on given message data ?