php和java base64编码,PHP中的Base64_encode()是否等于java.util.Base64?

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!!

解决方案

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值