(str)
| 113961 | // ================ |
| 113962 | var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; |
| 113963 | function base64clean(str) { |
| 113964 | // Node takes equal signs as end of the Base64 encoding |
| 113965 | str = str.split("=")[0]; |
| 113966 | // Node strips out invalid characters like \n and \t from the string, base64-js does not |
| 113967 | str = str.trim().replace(INVALID_BASE64_RE, ""); |
| 113968 | // Node converts strings with length < 2 to '' |
| 113969 | if (str.length < 2) return ""; |
| 113970 | // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not |
| 113971 | while(str.length % 4 !== 0)str = str + "="; |
| 113972 | return str; |
| 113973 | } |
| 113974 | function utf8ToBytes(string, units) { |
| 113975 | units = units || Infinity; |
| 113976 | var codePoint; |
no test coverage detected