Giter VIP home page Giter VIP logo

Comments (4)

ia0 avatar ia0 commented on July 20, 2024

Thanks for the suggestion! I think it makes sense to do something like that however:

  1. I won't have time to work on it before mid June.
  2. I'm not sure it will be possible to have those functions const. If not I'll expose them in data-encoding-macro. Or if possible in nightly I'll add a feature.

I'll come back to this later.

from data-encoding.

ia0 avatar ia0 commented on July 20, 2024

As expected, making {encode,decode}_len const fns does not work for a few different reasons:

  • I use traits and it's not possible to have const fn in traits.
  • I use Cow (when the alloc feature is enabled) and rely on Deref which is not const.

So I'll go with the solution of making those functions macros in the data-encoding-macro crate. I'll only have time to look at this at the earliest this week-end though. I'll ping here when done.

from data-encoding.

ia0 avatar ia0 commented on July 20, 2024

You can test if #70 is fixing your issue. Instead of writing let buf = [0u8; BASE64.encode_len(32)]; as in your original comment, you would need to write let buf = [0u8; base64_encode_len!(32)]; instead. If that's useful, I'll merge and make a release.

from data-encoding.

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.