base64-regex
base64-regex copied to clipboard
Regular expression for matching base64 encoded strings
== lines not = to avoid false positives Fixed
`438026444` convert to base64 string is `NDM4MDI2NDQ0`, the regex can't match this. [This function](https://github.com/chriso/validator.js/blob/master/src/lib/isBase64.js) works well.
Fixes #8 Fixes #7 Closes #5 Fixes #4
`index.js` in the repository has an extra `?` in the exact string interpolation, causing them to validate different things. Published version: https://cdn.jsdelivr.net/npm/[email protected]/index.js In repository: https://github.com/kevva/base64-regex/blob/0f0065cb1a1c75dc13c603c424f19103a2294782/index.js I believe neither of the...
When i try to validate large audio base64 buffer i got below error - RangeError: Maximum call stack size exceeded Audio file size approx 5MBb
Issue #4 still seems to be unresolved. Here's a fix using [@def00111's suggested regular expression](https://github.com/kevva/base64-regex/issues/4#issuecomment-344591881).
[This]( http://www.oxerfarm.com/images/smalltest.pdf) PDF-file does not validate as a valid base64. Any idea why? ```js const fs = require('fs') const base64Regex = require('base64-regex') const b64 = fs.readFileSync('./smalltest.pdf' ,'base64') console.log(b64) // missing...