(str)
| 1404 | |
| 1405 | var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; |
| 1406 | function base64clean(str) { |
| 1407 | // Node takes equal signs as end of the Base64 encoding |
| 1408 | str = str.split('=')[0]; |
| 1409 | // Node strips out invalid characters like \n and \t from the string, base64-js does not |
| 1410 | str = str.trim().replace(INVALID_BASE64_RE, ''); |
| 1411 | // Node converts strings with length < 2 to '' |
| 1412 | if (str.length < 2) return ''; |
| 1413 | // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not |
| 1414 | while (str.length % 4 !== 0) { |
| 1415 | str = str + '='; |
| 1416 | } |
| 1417 | return str; |
| 1418 | } |
| 1419 | function utf8ToBytes(string, units) { |
| 1420 | units = units || Infinity; |
| 1421 | var codePoint; |
no outgoing calls
no test coverage detected
searching dependent graphs…