diff --git a/bower_components/unibabel/unibabel.base32.js b/bower_components/unibabel/unibabel.base32.js index 219f815..7e4142a 100644 --- a/bower_components/unibabel/unibabel.base32.js +++ b/bower_components/unibabel/unibabel.base32.js @@ -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)); } };