MCPcopy Index your code
hub / github.com/plotly/plotly.js / getLens

Function getLens

stackgl_modules/index.js:1976–1993  ·  view source on GitHub ↗
(b64)

Source from the content-addressed store, hash-verified

1974revLookup['_'.charCodeAt(0)] = 63
1975
1976function 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
1996function byteLength (b64) {

Callers 2

byteLengthFunction · 0.85
toByteArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…