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

Base16 and Base64 for PicoRuby #165

Merged
merged 9 commits into from
Apr 10, 2024
Merged

Base16 and Base64 for PicoRuby #165

merged 9 commits into from
Apr 10, 2024

Conversation

sylph01
Copy link
Contributor

@sylph01 sylph01 commented Apr 8, 2024

I've implemented Base16 (equivalent of pack('H*) / unpack1('H*')) and Base64.
I will be using them to test cryptographic functions that are going to be added into the MbedTLS gem. This might be of general interest when networking functionality comes to PicoRuby.

Base64's interface is pretty much the same as CRuby, except it does not include line breaks.
Base16's interface is built to look like Base64's, so it works like this:

irb> s = Base16.encode16 'hogefugapiyo'
=> "686f6765667567617069796f"
irb> Base16.decode16 s
=> "hogefugapiyo"

Screenshot_20240408_201902

@hasumikin hasumikin merged commit b2d4a5d into picoruby:master Apr 10, 2024
1 check passed
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.

None yet

2 participants