puzhibing
2023-11-25 53e7558400dcacecdce70e39ebfe1727740f9296
cloud-server-account/src/main/java/com/dsh/account/util/weChat/WxPKCS7Encoder.java
@@ -4,10 +4,11 @@
import java.util.Arrays;
/**
* 微信小程序加解密
* @author pzb
* @Date 2021/12/3 15:43
*/
 * 微信小程序加解密
 *
 * @author pzb
 * @Date 2021/12/3 15:43
 */
public class WxPKCS7Encoder {
    private static final Charset CHARSET = Charset.forName("utf-8");
    private static final int BLOCK_SIZE = 32;
@@ -15,8 +16,7 @@
    /**
     * 获得对明文进行补位填充的字节.
     *
     * @param count
     *            需要进行填充补位操作的明文字节个数
     * @param count 需要进行填充补位操作的明文字节个数
     * @return 补齐用的字节数组
     */
    public static byte[] encode(int count) {
@@ -37,8 +37,7 @@
    /**
     * 删除解密后明文的补位字符
     *
     * @param decrypted
     *            解密后的明文
     * @param decrypted 解密后的明文
     * @return 删除补位字符后的明文
     */
    public static byte[] decode(byte[] decrypted) {
@@ -52,8 +51,7 @@
    /**
     * 将数字转化成ASCII码对应的字符,用于对明文进行补码
     *
     * @param a
     *            需要转化的数字
     * @param a 需要转化的数字
     * @return 转化得到的字符
     */
    public static char chr(int a) {