-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add js_escape and js_unescape #1979
Conversation
I've just realized this could also go in |
Is there anything I can do to get this across the line? In the meantime can this please be given the label |
Fiddling would be a better place I guess. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally had time to review this thoroughly. I am now sure I understand (and agree with) everything I haven't mentioned.
fedd6cd
to
de3162e
Compare
* Add js_escape and js_unescape * Add entry for js packing functions * Use hardcoded data for doctest * Fix js_escape data iteration for Python 2 * Move js packing functions to util.fiddling * Apply suggestions from code review Co-authored-by: Arusekk <arek_koz@o2.pl>
This adds
util.packing.js_escape()
andutil.packing.js_unescape()
These are useful for preparing binary data in such a way that it can be placed in memory using a JavaScript engine.
I'm not completely sure that I'm using
@LocalNoarchContext
correctly, or that my function signatures/docstrings are correct.Demo
Using IE11, this cyclic pattern can be put into memory with:
WinDbg then says: