Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Multiplatform Base64 library #90

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

Conversation

qwwdfsad
Copy link
Contributor

@qwwdfsad qwwdfsad commented Oct 3, 2018

No description provided.

@qwwdfsad
Copy link
Contributor Author

qwwdfsad commented Oct 3, 2018

cc @jonnyzzz

@StefMa
Copy link

StefMa commented Dec 16, 2019

Any reasons why this isn't an official library of jetbrains?
Or are there plans to extract it and publish it?

Cause it is very helpful. :)

while (index < src.size) {
val symbolsLeft = src.size - index
val padSize = if (symbolsLeft >= 3) 0 else (3 - symbolsLeft) * 8 / 6
val chunk = (src.getOrZero(index) shl 16) or (src.getOrZero(index + 1) shl 8) or src.getOrZero(index + 2)
Copy link

Choose a reason for hiding this comment

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

I think there is a mistake here, it should be:

 val chunk = (getOrZero(index) and 0xff shl 16) or
                    (getOrZero(index + 1) and 0xff shl 8) or
                    (getOrZero(index + 2) and 0xff)

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

Successfully merging this pull request may close these issues.

None yet

3 participants