nameHash static method
Implementation
static String nameHash(String? inputName) {
var node = '';
for (var i = 0; i < 32; i++) {
node += '00';
}
if (inputName != null) {
if (!inputName.contains('.eth')) {
inputName = '$inputName.eth';
}
var labels = inputName.split('.');
for (var i = labels.length - 1; i >= 0; i--) {
String labelSha;
if (isEncodedLabelhash(labels[i])) {
labelSha = decodeLabelhash(labels[i]);
} else {
var normalisedLabel = labels[i];
labelSha = sha3(normalisedLabel);
}
node = sha3(String.fromCharCodes(hex.decode('$node$labelSha')));
}
}
return '0x' + node;
}