The `hashCode` property in Dart returns the hash code for the sequence of Unicode code points.
The syntax of Runes.hashCode property is:
int hashCode
This hashCode property of Runes the hash code for this object.
Runes.hashCode returns value of type int
.
In this example,
runes
from the string 'Hello'.hashCode
property to get its hash code.void main() {
Runes runes = Runes('Hello');
int hash = runes.hashCode;
print('Hash code: $hash');
}
Hash code: 619442723
In this example,
emojis
from the string '👋🏽🚀🌟'.hashCode
property to get its hash code.void main() {
Runes emojis = Runes('👋🏽🚀🌟');
int emojiHash = emojis.hashCode;
print('Emoji hash code: $emojiHash');
}
Emoji hash code: 114058667
In this Dart tutorial, we learned about hashCode property of Runes: the syntax and few working examples with output and detailed explanation for each example.