-
Notifications
You must be signed in to change notification settings - Fork 383
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
feat(stdlibs): add encoding
, encoding/{base32,binary,csv}
#1290
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
converting to draft for now, mark as ready when it's done :) full implementation of encoding/binary requires reflection; not sure what category I put it into but if you just do varint it should be good 👍 |
@thehowl Thanks! I'll trying to finishing |
don't forget to update the docs/ folder, thank you. |
@moul don't worry, I'll update together when it's done. |
encoding
, encoding/{base32,binary,csv}
encoding
, encoding/{base32,binary,csv}
encoding
, encoding/{base32,binary,csv}
@notJoon please fix tests :) ( if you need any help ping me on signal |
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 made a bunch of gymnastics to try as much as possible to copy over tests and code from the Go stdlib, with some decent amount of success.
I put some fixes in to base32, made varint be 1:1 with the go stdlibs. I also worked a bunch on the csv package, but for now I'm giving up on continuing the fixes.
You're welcome to pick up where I left off. (If you don't, I'll probably pick it up some other day.) Use the following command from gnovm
to do tests:
go test tests/*.go -run "TestPackages/(encoding)/csv" -v
I'll add this command to the meta stdlibs issue.
Thank you for your efforts!
A very simple ID generation package, designed to be used in combination with `avl.Tree`s to push values in order. The name was originally `seqid` (sequential IDs), but after saying it a few times I realised it was close to "squid" and probably would be more fun if I named it that way ;) There's another piece of functionality that I want to add, which is a way to create simple base32-encoded IDs. This depends on #1290. These would also guarantee alphabetical ordering, so a list of them can be easily sorted and you'd get it in the same order they were created. They would likely be 13 characters long, but I'm also thinking of making a compact version which works from [0,2^35) which is 7 chracters, and then smoothly transitions over to the 13 characters version when the ID is reached. (I've experience with both base64 and base32 encoded IDs as 64-bit numbers, as I used both systems. The advantage of base32 is that it makes IDs case insensitive, all the while being at most 13 bytes instead of 11 for base64.) In GnoChess, we used simple sequential IDs combined with [`zeroPad9`](https://github.com/gnolang/gnochess/blob/7e841191a4a0a94c0d46bc977458bd6b757eab5e/realm/chess.gno#L287-L296) to create IDs which were both readable and sortable. I want to make a more "canonical" solution to this which does not have a upper limit at 1 billion entries.
@thehowl What's the status on this PR? |
@zivkovicmilos current status: some tests still failing, need to investigate and finish them up; putting this back in draft for now |
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
PR is now ready, but depends on two other PRs to fix VM bugs which were causing problems in the tests |
WIP
encoding
encoding/base32
encoding/binary
encoding/csv
: Due to thereflect
does not implemented yet, skippedfuzz
encoding/asn1
: better afterreflection
related to:
depends-on: