Skip to content

Instantly share code, notes, and snippets.

@rreinhardt9
Created March 16, 2015 17:35
Show Gist options
  • Save rreinhardt9/bfe3de4b423ab3eb4a22 to your computer and use it in GitHub Desktop.
Save rreinhardt9/bfe3de4b423ab3eb4a22 to your computer and use it in GitHub Desktop.
// To debug a base64 with invalid characters, here called 'buggy'
for (var i = 0; i < buggy.length; i++) {
if (buggy[i].charCodeAt(0) > 255) {
console.warn('found character ' + buggy[i].charCodeAt(0) + ' "' + buggy[i] + '" at position ' + i);
}
}
// From here:
// http://stackoverflow.com/a/25171633
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment