-
Notifications
You must be signed in to change notification settings - Fork 569
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
Need help with base128 #135
Comments
A proper base128 implementation would require a complete rework of the underlying logic as it is designed for 16 bytes (utf16). While this could probably be done, I am curious about the use case for this feature request. What would this accomplish that the current library does not? |
My colleague maintains a PAC-script for Russian censorship circumvention project at https://antizapret.prostovpn.org.
The PAC-script is not Unicode, it is 7-bit ASCII so 128 chars are allowed plus we have to escape some chosen kind of JS string delimiters and the escape symbol itself. If you need an example of such PAC-script, it is accessible here: https://antizapret.prostovpn.org/proxy.pac, -- its generator is in this repo if I'm not mistaken: https://bitbucket.org/anticensority/antizapret-pac-generator-light. I would appreciate any help. Thanks. |
if you are limited to ascii characters, the only way to do 128 base would be as hex codes. I'm not sure how much this will help your use case as each "number" would be represented by 2 characters. I think we would need a much more technical breakdown to understand the limitations you are working under and how best to advise you. |
I don't understand. I imagine it like this: // PAC-script, proxy.pac
const payload =
`CompactBase128HereWithEscapedBackticks\`AndSlashes\\AndExpressions\${AndOtherAscii~!@#$%^&*()_+
And Whitespace`;
eval(decodeFromBase128(payload)); As base128 has more symbols for encoding then the compressed form should be more compact than base64. |
Wouldn't uint8array be better then? As that simply doesn't need to escape anything (although loading it in again might be an issue, see #139 - might also affect some network transfers due to JS being "smart") -
|
How to initialize a uint8array inside a downloaded PAC-script? But I think you want to say that in-runtime compressed representation may be converted from an input string into uint8array via |
I try to apply lz-string to produce and consume strings encoded in base128.
Could you, please, help me with it?
This is how I fail at it:
The text was updated successfully, but these errors were encountered: