How to calulate ObjectDigest?

Why do I need the ObjectDigest?

As a hardware wallet developer, I need to know exactly what object is being transferred when signing SUI transactions like “transferObject”, whether it is SUI, token, or something else. However, I cannot find a good way to determine this information. Therefore, I think that I can verify the information passed from software by using ObjectDigest. How can I obtain the ObjectDigest?

Alternatively, is there another way to achieve this?


In the document, it states that “The object digest is the hash of the object’s contents and metadata”. However, I cannot find more information about it. Since I am not good at Rust, it is difficult for me to understand it from the Sui-code. I hope someone can help.