1. 程式人生 > >生成16位的key(筆記)

生成16位的key(筆記)

    public static void main(String[] args) {
        String keyStr = "root";
        byte[] keys;
		try {
			keys = keyStr.getBytes("UTF-8");
	        System.out.println(Base64Utils.encodeToString(Arrays.copyOf(keys, 16)));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
        
    }