Giter Club home page Giter Club logo

Comments (7)

mpvl avatar mpvl commented on September 18, 2024 1

It still makes sense to support conversions, but it probably makes sense to interpret [Size]byte as []byte, and not a list of ints in the first place.

This would be a relatively minor, but breaking change, but presumably a welcome one and I think it is worth it. Feedback welcome.

from cue.

pavel-khritonenko avatar pavel-khritonenko commented on September 18, 2024

Want to calculate Sha1 checksum and then encode it into Base64 string, but I'm unable to do that, because:

cannot use [164,124,236,58,150,40,5,40,196,175,13,142,106,236,181,44,17,99,146,48] (type list) as string|bytes in argument 2 to encoding/base64.Encode

from cue.

pavel-khritonenko avatar pavel-khritonenko commented on September 18, 2024

And in that case, the main root that [Size]byte defined as the return type in crypto/* packages is not being treated as bytes.

from cue.

pavel-khritonenko avatar pavel-khritonenko commented on September 18, 2024

@mpvl I wondering if there is a working example of crypto/sha1 pkg usage. Cannot imagine where I would like to have [...int] type instead of bytes. I checked all other public packages, only crypto/* packages have such return type.

And it's a definitely different issue than conversion between types.

from cue.

mpvl avatar mpvl commented on September 18, 2024

I think it is unlikely. We are still in a change where changes can be made if it makes sense (with due consideration of course), but here I think it is obvious.

These APIs were generated before CUE had a bytes type. Now it does, it seems consistent to use it not only for []byte, but also [...]byte.

from cue.

mpvl avatar mpvl commented on September 18, 2024

I've checked, and such a change in interpretation would only affect the crypto packages.

from cue.

cueckoo avatar cueckoo commented on September 18, 2024

This issue has been migrated to cue-lang/cue#3.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

from cue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.