Bitcoin/address validation: Difference between revisions

'Off by one' error, but this is a critical fix. The entire range of items in output array must be evaluated. This change is necessary so that pay to script hash (P2SH) addresses that start with 3 can be validated as well.
(Added Kotlin)
('Off by one' error, but this is a critical fix. The entire range of items in output array must be evaluated. This change is necessary so that pay to script hash (P2SH) addresses that start with 3 can be validated as well.)
Line 694:
int p = ALPHABET.indexOf(t);
if (p == -1) return null;
for (int j = len - 1; j >= 0; j--, p /= 256) {
p += base * (output[j] & 0xFF);
output[j] = (byte) (p % 256);