0
我輸入十六進制是轉換爲基礎64字符串
C30A010000003602000F73B32F9ECA00E9F2F2E9
我需要將其轉換爲以下基本64編碼字符串:
wwoBAAAANgIAD3OzL57KAOny8uk=
我可以模擬在這個網站這一轉變: http://www.asciitohex.com/,但我似乎無法使用本網站和網絡上其他地方建議的各種base64編碼器Util在Java中使用此轉換。例如,
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Base64;
public class Test {
public static void main(final String args[]) throws DecoderException {
String hexString = "C30A010000003602000F73B32F9ECA00E9F2F2E9";
String output = new String(Base64.encodeBase64String(hexString.getBytes()));
System.out.println(output);
}
但是輸出因爲這是不同的東西:
QzMwQTAxMDAwMDAwMzYwMjAwMEY3M0IzMkY5RUNBMDBFOUYyRjJFOQ==
任何人都可以提出如何得到這個轉型成功的工作?
感謝
謝謝 - 做到了! – 2014-09-25 13:28:15