package com.zksy.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 工具类
 */
public class ConvertUtil {
    /**
     * 字符串转数组
     * @param str 字符串
     * @return
     */
    public static List stringToChar(String str){
        List list = new ArrayList<>();
        for (int i = 0; i < str.length(); i=i+2) {
            String s = str.substring(i, i+2);
            list.add(s);
        }
        List list1 = (List) list.stream().map(s -> "0x"+s).collect(Collectors.toList());
        return list1;
    }
}
