debugging mobile safari
This commit is contained in:
parent
51ab2d9797
commit
92b62946d3
|
@ -95,6 +95,7 @@ exports.base32ToBuffer = function(encoded) {
|
||||||
} else {
|
} else {
|
||||||
decoded = new Array(len);
|
decoded = new Array(len);
|
||||||
}
|
}
|
||||||
|
console.log('debug mobile safari: decoded', decoded);
|
||||||
|
|
||||||
/* byte by byte isn't as pretty as octet by octet but tests a bit
|
/* byte by byte isn't as pretty as octet by octet but tests a bit
|
||||||
faster. will have to revisit. */
|
faster. will have to revisit. */
|
||||||
|
@ -131,11 +132,15 @@ exports.base32ToBuffer = function(encoded) {
|
||||||
throw new Error('Invalid input - it is not base32 encoded string');
|
throw new Error('Invalid input - it is not base32 encoded string');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('debug mobile safari: decoded 2', decoded);
|
||||||
if (decoded.slice) {
|
if (decoded.slice) {
|
||||||
|
console.log('debug mobile safari: decoded 3a', decoded);
|
||||||
return decoded.slice(0, plainPos);
|
return decoded.slice(0, plainPos);
|
||||||
} else {
|
} else {
|
||||||
|
console.log('debug mobile safari: decoded 3b', decoded);
|
||||||
// Mobile Safari's Uint8Array doesn't have slice
|
// Mobile Safari's Uint8Array doesn't have slice
|
||||||
return Array.prototype.slice.call(decoded, 0, plainPos);
|
return new Uint8Array(Array.prototype.slice.call(decoded, 0, plainPos));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue