You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if a PR would be accepted that changes the Alphabet::new function, or adds a new one, that doesn't have the check that prevents an Alphabet being created if it contains the = character. This is because I have an alphabet like this:
I have read the README, and I understand this is obviously non-standard, but currently there is no way to create an alphabet containing the = character if it's not used for padding.
The text was updated successfully, but these errors were encountered:
My condolences for the awful universe you are inhabiting. :(
I think the least awful way to handle this abomination would be to get rid of the PAD_BYTE const and instead have each Alphabet specify the relevant padding byte. That will require plumbing the pad byte through a number of places, but it would be easy enough logic to follow, and would still allow the alphabet to check that the tokens don't include the associated pad byte.
In the meantime for a quick but regrettable fix, you could apply some judicious replace(). I also suggest revoking commit privileges for whoever came up with that base64 alphabet.
I also need a feature that allows me to change the padding byte to - within my custom alphabet. For now the replace will work for me since '=' does not appear in my alphabet, but it's a bit unfortunate that the alphabet is configurable but the padding byte is not.
I would suggest dropping the Alphabet type and instead putting that together with the padding settings directly into the GeneralPurpose engine type. That would allow that you don't have to specify a padding byte at all if you don't need one, which is probably the OPs use case.
I was wondering if a PR would be accepted that changes the
Alphabet::new
function, or adds a new one, that doesn't have the check that prevents anAlphabet
being created if it contains the=
character. This is because I have an alphabet like this:4QTRhE+Hiz0Nme6DsnuAFCP8WaojxdVOZpKL53r2=BIkqSUcbYJG91tvX7lywMgf
I have read the README, and I understand this is obviously non-standard, but currently there is no way to create an alphabet containing the
=
character if it's not used for padding.The text was updated successfully, but these errors were encountered: