cyberphone / json-canonicalization

JSON Canonicalization Scheme (JCS)
Other
98 stars 23 forks source link

Port go implementation into idiomatic go, add tests and add support for JSON Simple types #12

Closed beeemT closed 3 years ago

beeemT commented 3 years ago

@cyberphone I understand the PR is a lot bigger compared to implementation size than maybe usual. I am happy to continue this as a fork if you do not want to substantially change the implementation of JCS in your repo. I ported your testing utilities for the Transfom and NumberToJSON from executables to real go tests. In the test for NumberToJSON i made it optional to run the long test with the es6testfile100m.txt . I split up your massive Transform function into smaller ones and did a bit of refactoring.

Also i implemented Issue #11 including a testcase for it.

All tests work and pass, i also ran the long 100million NumberToJSON test which also passed.

cyberphone commented 3 years ago

dear @beeemT I'm sure this is an awesome update!

However, I'm not really ready for taking on this code at the moment. Would it make sense that I rather add a link to your site/repository? I'm also involved in a Go-based project using https://tools.ietf.org/html/draft-jordan-jws-ct-02 which may turn up in https://github.com/jws-ct

I'm not (much of) a Go programmer; is there some kind of universal repository somewhere?

beeemT commented 3 years ago

No Problem, I am happy to continue this as a fork. Yeah adding a link is fine.

With universal repository you mean the standard library ? Anything you need to know about contributing to the go project can be found here: https://golang.org/project/ If you want resources on how to program go you find these here: https://golang.org/doc/ I think that the "Effective Go" document is particularly important: https://golang.org/doc/effective_go.html

cyberphone commented 3 years ago

Since my Go knowledge is somewhat limited I got a bit puzzled when looking into your code. A quick browse on the Web gave me the answer: https://thenewstack.io/spaces-vs-tabs-a-20-year-debate-and-now-this-what-the-hell-is-wrong-with-go/ This was quite funny but for a java-guy like me it felt unnatural using tabs but apparently that's the way it is. It is a pity that they didn't settle on a more reasonable (and fixed) tab-size than 8 😟 4 seems entirely sufficient.

Your code is obviously much more suited as a contribution to the Go community than my code which was mostly written to verify that you actually can create a compatible JCS implementation in Go as well!

jordan2175 commented 3 years ago

@beeemT Anders and I are moving this project over to a new home on Github https://github.com/gowebpki/jcs. In this new home I will be taking over more of the day-2-day golang work. Would you be willing to contribute your changes there?