feat:encode sfn > functionId & extractedFilename
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] Addresses an existing open issue: fixes #1859
- [ ] Tests for the changes have been added (for bug fixes / features)
What is the current behavior?
What is the new behavior?
Other information
The encoded characters are guaranteed to be ASCII characters, and the path before src is removed to improve security and reduce string size
Currently encoded as base64, the size increases by 25%, but I don't know if there is a better way
⚠️ No Changeset found
Latest commit: b640817896d7821920bf09eb08c6fa0b0aa1a9d1
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Deploy Preview for solid-start-landing-page ready!
| Name | Link |
|---|---|
| Latest commit | b640817896d7821920bf09eb08c6fa0b0aa1a9d1 |
| Latest deploy log | https://app.netlify.com/sites/solid-start-landing-page/deploys/67ec9cd71d4b760008d7a51b |
| Deploy Preview | https://deploy-preview-1872--solid-start-landing-page.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Could probably use a simple hash such as a xxhash32(filename), but otherwise this is fine.
Could probably use a simple hash such as a xxhash32(filename), but otherwise this is fine.
~~Hash functions are usually irreversible.~~
~~if use encryption algorithms (such as AES) or compression algorithms (such as lz-string), need to decode it every time call handleServerFunction, which may cause high CPU consumption and network latency.~~
~~So I choose to use base64 for now.~~
I have come up with a solution that can use hash algorithm,` HandleServerFunction does not require decoding. I need some time to verify
I don't think we need to decode anything. We just use the IDs for lookup and verification anyways.
Now,only Encode extractedFilename with encodeURIComponent.
In addition, I found that extractedFilename is not used in this process, 🤔 maybe it can be removed?
@lxsmnsyc any other comments on this pr?
@brenelz this PR is fine, but we'll need a solution that outputs a shorter output like xxhash32
@thinke5 did you want to look at this following Alexis' comment?