Hi,
I'm looking for a class that can do base64_(encode/decode). I'm not in need of the function that PHP supports. I need this for educational purposes. If anyone has any ideas about a class that can do this I would like to know about it. (or other languages than PHP).
base64_encode() & base64_decode() class?
Moderator: General Moderators
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: base64_encode() & base64_decode() class?
what's wrong with the built-in functions? 
Re: base64_encode() & base64_decode() class?
I think he wants to learn how its done.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: base64_encode() & base64_decode() class?
The base64 encoding specification can be found in RFC 2045. I'm sure there's a more complete specification elsewhere but there's definitely one in RFC 2045.
Nobody is likely to have written one in PHP since the functions already exist, but you can find Java implementations (which should more or less read like OO PHP).
Here's one in Java: http://www.source-code.biz/snippets/jav ... r.java.txt
Nobody is likely to have written one in PHP since the functions already exist, but you can find Java implementations (which should more or less read like OO PHP).
Here's one in Java: http://www.source-code.biz/snippets/jav ... r.java.txt
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: base64_encode() & base64_decode() class?
And here's a simpler encode-only implementation: http://www.koders.com/java/fid498747F58 ... 2433D.aspx
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: base64_encode() & base64_decode() class?
Yes like someone said after you, I am looking for that in terms of education. I want to know how it's done.The Ninja Space Goat wrote:what's wrong with the built-in functions?
I found a few classes that are non-PHP. It would be easier if it's PHP, but well non-PHP is still better than nothing
@Chris Corbyn: Thanks for the links. I'll have a look at them.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: base64_encode() & base64_decode() class?
We have a user here called "Weirdan". He's posted base64 encoding/decoding algorithms here using JavaScript before if you find that easier to read than Java
It'll be in the "Code Snippets" forum if you want to search for the thread.
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: base64_encode() & base64_decode() class?
Thanks a bunch.Chris Corbyn wrote:We have a user here called "Weirdan". He's posted base64 encoding/decoding algorithms here using JavaScript before if you find that easier to read than JavaIt'll be in the "Code Snippets" forum if you want to search for the thread.