(b64)
| 1974 | revLookup['_'.charCodeAt(0)] = 63 |
| 1975 | |
| 1976 | function getLens (b64) { |
| 1977 | var len = b64.length |
| 1978 | |
| 1979 | if (len % 4 > 0) { |
| 1980 | throw new Error('Invalid string. Length must be a multiple of 4') |
| 1981 | } |
| 1982 | |
| 1983 | // Trim off extra bytes after placeholder bytes are found |
| 1984 | // See: https://github.com/beatgammit/base64-js/issues/42 |
| 1985 | var validLen = b64.indexOf('=') |
| 1986 | if (validLen === -1) validLen = len |
| 1987 | |
| 1988 | var placeHoldersLen = validLen === len |
| 1989 | ? 0 |
| 1990 | : 4 - (validLen % 4) |
| 1991 | |
| 1992 | return [validLen, placeHoldersLen] |
| 1993 | } |
| 1994 | |
| 1995 | // base64 is 4/3 + up to two characters of the original data |
| 1996 | function byteLength (b64) { |
no outgoing calls
no test coverage detected
searching dependent graphs…