您的位置:首页 > 编程语言 > Java开发

用JAVA 字符串转hex字符串

2016-06-15 08:47 393 查看
    /**

     * 字符串转hex字符串

     * @throws UnsupportedEncodingException 

     */    

    public static String strToHex(String str) throws UnsupportedEncodingException {

        return String.format("%x", new BigInteger(1, str.getBytes("UTF-8")));

        

    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: