Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to use php to pass and get a encoded string to other system which are using java.util.Base64 to encode and decode. Can I use base64_encode($str) to encode and pass the string to them for decode in php and can i use base62_decode($str) to decode what I get from java.util.Base64 in php? Or is there other way to encode and decode java.util.Base64 string in php?

Thanks!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
250 views
Welcome To Ask or Share your Answers For Others

1 Answer

Short Answer: Yes.

Base64 is a standard.

Long Answer:

The PHP documentation for base64_encode references RFC 2045 which is the MIME base64 encoding.

The Javadoc tells that Java supports different types of Base64, one of which is MIME. The Basic type should also work. The main difference is that the MIME type requires that no line is longer than 76 characters.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...