debugging mobile safari
This commit is contained in:
parent
51ab2d9797
commit
92b62946d3
|
@ -95,6 +95,7 @@ exports.base32ToBuffer = function(encoded) {
|
|||
} else {
|
||||
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
|
||||
faster. will have to revisit. */
|
||||
|
@ -131,11 +132,15 @@ exports.base32ToBuffer = function(encoded) {
|
|||
throw new Error('Invalid input - it is not base32 encoded string');
|
||||
}
|
||||
}
|
||||
|
||||
console.log('debug mobile safari: decoded 2', decoded);
|
||||
if (decoded.slice) {
|
||||
console.log('debug mobile safari: decoded 3a', decoded);
|
||||
return decoded.slice(0, plainPos);
|
||||
} else {
|
||||
console.log('debug mobile safari: decoded 3b', decoded);
|
||||
// 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