Giter VIP home page Giter VIP logo

Comments (1)

ia0 avatar ia0 commented on July 20, 2024

There's at least 3 options:

  • The solution in staktrace/mailparse#96 which is to define their own encoding with lazy-static.
  • Using data-encoding-macro which doesn't need lazy-initialization because it produces the encoding at compile-time (see below for a snippet).
  • Add a BASE64_MIME_PERMISSIVE constant in data-encoding. (I'm not willing to change the behavior of BASE64_MIME because this would be a breaking change. But adding a new constant for those who need to ignore trailing bits is fine.)
const BASE64_MIME_PERMISSIVE: data_encoding::Encoding = data_encoding_macro::new_encoding! {
    symbols: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
    padding: '=',
    check_trailing_bits: false, // NEW (defaults to true)
    wrap_width: 76,
    wrap_separator: "\r\n",
};

What do you think? Happy to add BASE64_MIME_PERMISSIVE if that's what you would prefer.

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.