Skip to content

Add a helper function that uses base64::write::EncoderWriter #4483

Closed as not planned

Description

@Xuanwo
          We can add a helper function that uses [base64::write::EncoderWriter](https://docs.rs/base64/0.22.0/base64/write/struct.EncoderWriter.html). But I believe it's out of the scope of current PR, maybe worth a new one.

Originally posted by @Xuanwo in #4477 (comment)

BASE64_STANDARD.encode(body) requires the whole slices which adds an extra copy for Buffer. We can use base64::write::EncoderWriter to allow build base64 from Buffer.

Activity

  1. Xuanwo commented on Apr 13, 2024

    @Xuanwo
    MemberAuthor

    Ah, EncoderWriter is not zero cost compared to encode. Maybe it's better to use Buffer::to_bytes() as is. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions