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

Add Base32 & Base64 on encodeString #2016

Closed
wants to merge 11 commits into from
Closed

Add Base32 & Base64 on encodeString #2016

wants to merge 11 commits into from

Conversation

fresholia
Copy link
Contributor

@fresholia fresholia commented Jan 17, 2021

Fixes #2002
Adding encodeString base32&base64

Example:

local str = encodeString("base32", "anan", {})
print(decodeString("base32", str, {})) -- output: anan

local str = encodeString("base64", "anan", {})
print(decodeString("base64", str, {})) -- output: anan

When the PR is approved, I will update it on the wiki.

@fresholia
Copy link
Contributor Author

I guess it could be done as follows, idk

encodeString("base", string, {radix = 32})

Copy link
Contributor

@patrikjuvonen patrikjuvonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request! Seems good, I haven't tested this yet but will do so soon.

Shared/sdk/SharedUtil.Hash.h Outdated Show resolved Hide resolved
@patrikjuvonen patrikjuvonen added this to the Confirmed Issues milestone Jan 17, 2021
@patrikjuvonen patrikjuvonen added the enhancement New feature or request label Jan 17, 2021
@patrikjuvonen patrikjuvonen self-requested a review January 17, 2021 15:25
@patrikjuvonen
Copy link
Contributor

I guess it could be done as follows, idk

encodeString("base", string, {radix = 32})

I think base32 and base64 is better for now.

patrikjuvonen
patrikjuvonen previously approved these changes Jan 17, 2021
@patrikjuvonen patrikjuvonen self-requested a review January 17, 2021 15:26
@patrikjuvonen patrikjuvonen self-assigned this Jan 17, 2021
Copy link
Member

@sbx320 sbx320 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some minor changes.


In general we might want to look into making Encode/DecodeString a bit less repetitive. But don't bother with it for this PR.

Shared/mods/deathmatch/logic/luadefs/CLuaCryptDefs.cpp Outdated Show resolved Hide resolved
TEA
TEA,
BASE32,
BASE64
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The StringEncryptFunction name is a bit odd due to base64 not being an encryption method. Maybe we should change this to StringEncodeFunction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for review. I'll edit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cleopatradev This change is still pending.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cleopatradev This is still an issue.

@fresholia fresholia requested a review from sbx320 January 20, 2021 20:53
@TheNormalnij
Copy link
Contributor

TheNormalnij commented Jan 21, 2021

base32 should have alphabet option i think.
https://github.com/TheNormalnij/mtasa-blue/tree/TheNormalnij/base32

Copy link
Contributor

@Pirulax Pirulax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@patrikjuvonen patrikjuvonen changed the title Added Base32 & Base64 on encodeString Add Base32 & Base64 on encodeString Apr 10, 2021
@patrikjuvonen patrikjuvonen marked this pull request as draft April 10, 2021 13:48
@patrikjuvonen patrikjuvonen removed their assignment Apr 10, 2021
@Dutchman101
Copy link
Member

Dutchman101 commented Oct 11, 2021

Exactly what is needed for this to switch from draft to ready for more reviews or merging? The PR was changed to draft status by @patrikjuvonen, maybe clarify the reason or we can mark it as ready for review again.

@patrikjuvonen
Copy link
Contributor

Exactly what is needed for this to switch from draft to ready for more reviews or merging? The PR was changed to draft status by @patrikjuvonen, maybe clarify the reason or we can mark it as ready for review again.

sbx's request for change is still pending at #2016 (comment)

@fresholia fresholia closed this Oct 15, 2021
@fresholia
Copy link
Contributor Author

Wrong branches, wait the new PR

@patrikjuvonen patrikjuvonen removed this from the Backlog milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base32 support
6 participants