{"action":"created","issue":{"url":"https://api.github.com/repos/marklister/base64/issues/6","labels_url":"https://api.github.com/repos/marklister/base64/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/marklister/base64/issues/6/comments","events_url":"https://api.github.com/repos/marklister/base64/issues/6/events","html_url":"https://github.com/marklister/base64/issues/6","id":116321063,"number":6,"title":"Strict padding unnecessary -- causes JS interop problem","user":{"login":"bblfish","id":124506,"avatar_url":"https://avatars.githubusercontent.com/u/124506?v=3","gravatar_id":"","url":"https://api.github.com/users/bblfish","html_url":"https://github.com/bblfish","followers_url":"https://api.github.com/users/bblfish/followers","following_url":"https://api.github.com/users/bblfish/following{/other_user}","gists_url":"https://api.github.com/users/bblfish/gists{/gist_id}","starred_url":"https://api.github.com/users/bblfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bblfish/subscriptions","organizations_url":"https://api.github.com/users/bblfish/orgs","repos_url":"https://api.github.com/users/bblfish/repos","events_url":"https://api.github.com/users/bblfish/events{/privacy}","received_events_url":"https://api.github.com/users/bblfish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-11T12:01:56Z","updated_at":"2015-11-13T11:55:49Z","closed_at":null,"body":"JS WebCrytpoAPI produces Base64URL encoded strings in `jws` mode.\r\n\r\nSee the code here to produce those \r\nhttp://stackoverflow.com/questions/33642310/is-there-a-way-to-get-the-components-of-an-rsa-key-in-the-webcrypto-api\r\n\r\nThe following JS code does the trick to convert it\r\n\r\n```JavaScript\r\nfunction encodeURL(str){\r\n    return str.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/\\=+$/, '');\r\n}\r\n\r\nfunction decodeUrl(str){\r\n    str = (str + '===').slice(0, str.length + (str.length % 4));\r\n    return str.replace(/-/g, '+').replace(/_/g, '/');\r\n}\r\n```\r\n\r\nand then one can use `window.atob`\r\n\r\nI tried the library here, but it gives an error "},"comment":{"url":"https://api.github.com/repos/marklister/base64/issues/comments/156411004","html_url":"https://github.com/marklister/base64/issues/6#issuecomment-156411004","issue_url":"https://api.github.com/repos/marklister/base64/issues/6","id":156411004,"user":{"login":"bblfish","id":124506,"avatar_url":"https://avatars.githubusercontent.com/u/124506?v=3","gravatar_id":"","url":"https://api.github.com/users/bblfish","html_url":"https://github.com/bblfish","followers_url":"https://api.github.com/users/bblfish/followers","following_url":"https://api.github.com/users/bblfish/following{/other_user}","gists_url":"https://api.github.com/users/bblfish/gists{/gist_id}","starred_url":"https://api.github.com/users/bblfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bblfish/subscriptions","organizations_url":"https://api.github.com/users/bblfish/orgs","repos_url":"https://api.github.com/users/bblfish/repos","events_url":"https://api.github.com/users/bblfish/events{/privacy}","received_events_url":"https://api.github.com/users/bblfish/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T11:55:49Z","updated_at":"2015-11-13T11:55:49Z","body":"Perhaps there is an extra improvement you can add. Is it possible to abstract somewhat from an array? For example the JS seems to return a [ArrayBuffer](https://github.com/scala-js/scala-js/blob/master/library/src/main/scala/scala/scalajs/js/typedarray/ArrayBuffer.scala) which I think can be turned into a java.nio.ByteBuffer using [TypedArrayBufferBridge](https://github.com/scala-js/scala-js/blob/master/library/src/main/scala/scala/scalajs/js/typedarray/TypedArrayBufferBridge.scala).\r\n\r\nSo it would be useful to have a method that could work with those elements and not just arrays. I am not yet quite sure what the best abstraction here would be... Certainly given that you don't need to change the source object, an Array is too precise."}}