Reputation: 1096
In substrate, I have a code to get hash:
let kitty = Kitty::<T> {
dna: String::from("test"),
price: None,
gender: String::from("male"),
owner: "there's an accountid here",
};
let kitty_id = T::Hashing::hash_of(&kitty);
Could I get the same kitty_id hash if the same kitty attribute was passed into hash_of function?
Upvotes: 1
Views: 173
Reputation: 641
No this doesn't return a random hash. It returns the hash of the input data.
Upvotes: 1