package com.muyu.parse.uitl;


/**
 * @version 1.0
 * @Author xie ya ru
 * @Date 2024/9/28 16:48
 * @注释
 */

public class DataParseUtil {
    public static final Integer STARTPOSITION = 0;

    public static final Integer ENDPOSITION = 18;

    public static final Integer INDEX = 16;
    public static String dataParsing(String jsonVin){
        jsonVin = jsonVin.substring(STARTPOSITION,ENDPOSITION);
        StringBuilder asciiString = new StringBuilder();
        String[] split = jsonVin.split(" ");
        for (int i = 0; i < split.length; i++) {
            //十六进制转换为十进制
            int decimal = Integer.parseInt(split[i],INDEX);
            //将十进制整数转换为字符
            char  character =(char)decimal;
            //添加字符到ASCII 字符串
            asciiString.append(character);
        }
        System.out.println(asciiString.toString());
        return asciiString.toString();
    }
}
