Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base64 validation without regular expressions #503

Merged
merged 4 commits into from
Feb 20, 2016

Conversation

chriso
Copy link
Collaborator

@chriso chriso commented Feb 19, 2016

This fixes #502.

chriso added a commit that referenced this pull request Feb 20, 2016
Base64 validation without regular expressions
@chriso chriso merged commit e2ccc9f into master Feb 20, 2016
@chriso chriso deleted the chriso/faster-base64-validation branch February 20, 2016 06:10
aloisklink added a commit to aloisklink/47ng-cloak that referenced this pull request Sep 24, 2024
The `cloakedStringRegex` fails to parse ciphertexts larger than about
4 MiB. This is due to [limitations in V8's regex engine][1].

I've adapted the implementation from
validatorjs/validator.js#503 under the MIT
license, as it solves the error.

[1]: https://issues.chromium.org/issues/42207207
franky47 added a commit to 47ng/cloak that referenced this pull request Sep 24, 2024
* fix: fix decrypting strings larger than 4 MiB

The `cloakedStringRegex` fails to parse ciphertexts larger than about
4 MiB. This is due to [limitations in V8's regex engine][1].

I've adapted the implementation from
validatorjs/validator.js#503 under the MIT
license, as it solves the error.

[1]: https://issues.chromium.org/issues/42207207

* feat: export `parseCloakedString` function

This function can be used instead of `cloakedStringRegex` on large
strings.

* feat: deprecate `cloakedStringRegex`

This regex fails on large 4 MiB + strings.
`parseCloakedString` should be used instead when possible.

* test: test decrypting strings larger than 4 MiB

This fails in Node.JS v20.17.0 with @47ng/cloak v1.1.0.

* chore: Make hex & base64 Regexes case-insensitive

---------

Co-authored-by: François Best <github@francoisbest.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack overflow when validating big base64 strings
1 participant