You are viewing a single comment's thread. Return to all comments →
Java
public static String encryption(String s) { s = s.replaceAll(" ", ""); int col = (int) Math.ceil(Math.sqrt(s.length())); String encrypt = ""; for (int i = 0; i < col; i++) { for (int j = 0; j < s.length(); j += col) { String str = s.substring(j); encrypt += (str.length() - 1 >= i) ? str.charAt(i) : ""; } encrypt += " "; } return encrypt; }
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →
Java