Neo.Mxn0
Neo.Mxn0

Reputation: 1096

Is substrate T::Hashing::hash_of(...) return a random hash?

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

Answers (1)

bkchr
bkchr

Reputation: 641

No this doesn't return a random hash. It returns the hash of the input data.

Upvotes: 1

Related Questions