Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop unused base64 code #212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

csware
Copy link
Contributor

@csware csware commented Feb 20, 2019

There are two base64 implementations in the Notepad2e source code.

Those files were moved to another folder in commit 42c30cd and not deleted, despite another implementation was added.

Signed-off-by: Sven Strickroth <[email protected]>
@ProgerXP
Copy link
Owner

@cshnik We don't actually use that base64 library anymore? See commit 42c30cd. Have you copied part of their code or was it rewritten from scratch? Do you remember why?

@cshnik
Copy link
Collaborator

cshnik commented Feb 21, 2019

@cshnik We don't actually use that base64 library anymore? See commit 42c30cd. Have you copied part of their code or was it rewritten from scratch? Do you remember why?

The algorithm originally represented by base64_encode, base64_decode methods in this module (base64.h/cpp) was re-implemented for our recoding engine. Later it was moved to StrToBase64.h/cpp.
If such a reuse of the code can't treated as Redistribution and use in source and binary forms, with or without modification than we can remove these files.
base54-license.txt

Copyright (c) 2002-2012, Jouni Malinen [email protected] and contributors
All Rights Reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

  3. Neither the name(s) of the above-listed copyright holder(s) nor the
    names of its contributors may be used to endorse or promote products
    derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@csware
Copy link
Contributor Author

csware commented Feb 21, 2019

If the algorithm in StrToBase64.h/cpp is directly based/copied from base64.c/h, then this file needs the header.

@csware
Copy link
Contributor Author

csware commented Feb 21, 2019

You could also use ATL for base64 to get rid of any dependency (https://msdn.microsoft.com/vstudio/ezec6x4e(v=vs.100)).

@ProgerXP
Copy link
Owner

If the algorithm in StrToBase64.h/cpp is directly based/copied from base64.c/h, then this file needs the header.

Yes, that's why I'm asking.

@cshnik Why did you have to reimplement base64 functions? Was it to skip whitespace and other invalid symbols during decoding? (#181)

@cshnik
Copy link
Collaborator

cshnik commented Feb 25, 2019

@cshnik Why did you have to reimplement base64 functions? Was it to skip whitespace and other invalid symbols during decoding? (#181)

For()-cycle presented in the original base64_encoded/base64_decode functions can't be directly used in our transcoding engine (which uses block-by-block scheme to provide UI responsiveness (no window freeze, provide progress bar updates)). Additional feature is input data filter which allow to skip invalid char sequence when decoding.
But the core idea/implementation is absolutely the same as provided in the original code.

@csware
Copy link
Contributor Author

csware commented Feb 26, 2019

What do you mean with "core idea"? Base64 is standardized.

@ProgerXP
Copy link
Owner

What do you mean with "core idea"? Base64 is standardized.

He probably means that the code was adapted from base64.h/c. Don't worry, we'll add the copyright notice later to this unit when I get time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants