/**
* int 转Base64编码
*
* @param d int类型数据
* @param limit 需要字节长度
* @return
*/
public static String intToLittleEndian(int d, int limit) {
byte[] bytes = intToByteArrayLittle(d);
ByteBuffer byteBuffer = ByteBuffer.allocate(limit);
for (int i = 0; i < limit; i++) {
byteBuffer.put(bytes[i]);
}
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
return Base64.getEncoder().encodeToString(byteBuffer.array());
}
int转base64编码
最新推荐文章于 2023-05-07 19:59:52 发布