I think should actually be 0x80000000 - 1, not 0x8000000 - 1; (you need to add one more zero ... there are only 7 digits in yours, but there should be 8). This number should be equal to the maximum value for a non-hardened index, which is 2^31 - 1;
```
var MAX_NON_HARDENED = 0x80000000 - 1;
```
or
```
var MAX_NON_HARDENED == Math.pow(2,31) - 1;
```