Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Base64 encoder shouldn't trim the input #13

Description

@mahmoudmohsen213

The base64 encoding plugin disregard any leading or trailing new line characters, which may be important in the original input, for example, encoding chunks of a csv file, where a new line character denotes the end of a record.

If it happened that the end of a chunk aligned with the end of a record (a new line character), it will be removed in the encoding, producing a corrupted file when decoded back.

Example input 01:

str01
str02
str03

Expected and actual:
c3RyMDEKc3RyMDIKc3RyMDM=

Example input 02:



str01
str02
str03

Expected:
CgpzdHIwMQpzdHIwMgpzdHIwMw==
Actual:
c3RyMDEKc3RyMDIKc3RyMDM=

Example input 03:

str01
str02
str03


Expected:
c3RyMDEKc3RyMDIKc3RyMDMKCg==
Actual:
c3RyMDEKc3RyMDIKc3RyMDM=

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions