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

Fix base32 validation #34

Merged
merged 4 commits into from
Dec 3, 2020
Merged

Fix base32 validation #34

merged 4 commits into from
Dec 3, 2020

Conversation

Ursify
Copy link
Contributor

@Ursify Ursify commented Dec 2, 2020

Hi Jason, Algorand Team.

Please review below regex update, I hope is fine and can pass your tests. Also, let me know if I need to point my pull request to codegen-test instead of master. This is my first pull request to a crypto project.

Cheers,
Ursify

Hi,
After checking the reference link to '6.  Base 32 Encoding', 'Table 3: The Base 32 Alphabet' has from 2-7 and not from 2-9. 
Cheers,
Adding more details to RegEx
This regex will validate bettter if input message is really a Base32 encoded message.
@CLAassistant
Copy link

CLAassistant commented Dec 2, 2020

CLA assistant check
All committers have signed the CLA.

@jasonpaulos
Copy link
Member

Hi @Ursify, thanks for catching this! TEAL actually supports base32 with padding and without padding, so I've made a modification to support both schemes and added some tests.

Once you sign the CLA I can approve this PR.

@jasonpaulos jasonpaulos changed the title Patch 1 Fix base32 validation Dec 2, 2020
@jasonpaulos jasonpaulos self-assigned this Dec 2, 2020
@jasonpaulos jasonpaulos merged commit 6ae1185 into algorand:master Dec 3, 2020
jasonpaulos added a commit that referenced this pull request Mar 1, 2021
* Valid_Base32 Error

Hi,
After checking the reference link to '6.  Base 32 Encoding', 'Table 3: The Base 32 Alphabet' has from 2-7 and not from 2-9.
Cheers,

* valid_base32 updates

Adding more details to RegEx

* Regex in Base32

This regex will validate bettter if input message is really a Base32 encoded message.

* Add tests & support base32 no padding

Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants