-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Request] De-/Encoding of adapted base64 #12
Comments
Oh? This sounds interesting! Do you have any examples of such libraries? It wouldn't be too much trouble to implement something like this - it would just come down to adding a new encoding and decoding table, and then writing the module api. |
I'm working on the The |
Oh and it's not always obvious from the documentation if any ... Should I maybe make a new issue for this inconsistency in documentation and availability of module functions? (I'd like a |
Ah i must have missed some documentation from when I removed unpadded std alphabet base64 support; thank you for bringing that up. So far, only the URL-safe alphabet is supported by an RFC calling for optionally padded encodings. This is kept that way because it's RFC compliant, and otherwise makes for a confusing API. However, you have Because it's important to be spec compliant, I am not willing to do an unpadded version of the std alphabet, but i'm happy to do this with any nonstandard alphabets, since they are not governed by an RFC! |
Ah, ok, that sounds reasonable. And on second thought, you're right, there's no instance I'd want to use a I hope the examples that the |
Hmmm, I've been scouring some more, and found it's also called And this bcrypt source code also has the order of: EDIT: Oh man the Base64 wiki shows that the EDIT2: Ok, the main reason I got into this is trying to parse Python's from passlib.utils.binary import ab64_encode
val = ab64_encode('>>>')
print val And it gives "Pj4." sigh which is literally standard base64, but the |
Thanks for hunting these down @Vlix. To address some of the issues raised here, I threw together an omnibus PR yesterday for all the things I want to get in before i do this here: #13 I'm probably going to punt on those TODO's in favor of getting yours in. I just need to sit at my screen on Monday and make sure it all makes sense to me first :) |
Yeah, it requires a bit of reading up, but I think it would make sense to have this in the library, even though some of it is somewhat obscure. No rush, I've found the encoding I was looking for isn't even really a different one, so I can just |
So just to follow up on this, I still do plan on doing this, but i don't want to start until we get Backpack supported in Stack. I'm just repeating the same module over and over, and it's not scalable. |
Just for future reference, I've found Passlib's charmaps which show:
|
I found that some libraries out there use a slightly different
base64
encoding, namely the "adapted base64 encoding", which is the same as regular base64 encoding, but with the+
replaced by the.
, and having no padding characters.Would be nice (and not too much work, I think?) to add something like
Data.ByteString.Base64.Adapted
to handle this type of base64 encoding?The text was updated successfully, but these errors were encountered: