Browse Source

standard

master
Feross Aboukhadijeh 8 years ago
parent
commit
e68ffbe30b
  1. 4
      index.js

4
index.js

@ -33,7 +33,7 @@ function placeHoldersCount (b64) {
function byteLength (b64) {
// base64 is 4/3 + up to two characters of the original data
return b64.length * 3 / 4 - placeHoldersCount(b64)
return (b64.length * 3 / 4) - placeHoldersCount(b64)
}
function toByteArray (b64) {
@ -41,7 +41,7 @@ function toByteArray (b64) {
var len = b64.length
placeHolders = placeHoldersCount(b64)
arr = new Arr(len * 3 / 4 - placeHolders)
arr = new Arr((len * 3 / 4) - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? len - 4 : len

Loading…
Cancel
Save