mirror of https://github.com/status-im/web3.js.git
off by one error
This commit is contained in:
parent
2682af7bd6
commit
d95b10a57a
|
@ -425,7 +425,7 @@ var isChecksumAddress = function (address) {
|
|||
|
||||
for (var i = 0; i < 40; i++ ) {
|
||||
// the nth letter should be uppercase if the nth digit of casemap is 1
|
||||
if ((parseInt(addressHash[i], 16) > 8 && address[i].toUpperCase() != address[i]) || (parseInt(addressHash[i], 16) <= 8 && address[i].toLowerCase() != address[i])) {
|
||||
if ((parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() != address[i]) || (parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() != address[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ var toChecksumAddress = function (address) {
|
|||
|
||||
for (var i = 0; i < address.length; i++ ) {
|
||||
// If ith character is 9 to f then make it uppercase
|
||||
if (parseInt(addressHash[i], 16) > 8) {
|
||||
if (parseInt(addressHash[i], 16) > 7) {
|
||||
checksumAddress += address[i].toUpperCase();
|
||||
} else {
|
||||
checksumAddress += address[i];
|
||||
|
|
Loading…
Reference in New Issue