String userName = sql.substring("CREATE USER ".length(), sql.indexOf("SALT ") - 1);
if (userName.startsWith("\"")) {
// TODO doesn't work for all cases ("" inside user name)
userName = userName.substring(1, userName.length() - 1);
}
SHA256 sha = new SHA256();
byte[] userPasswordHash = sha.getKeyPasswordHash(userName, "".toCharArray());
byte[] salt = MathUtils.secureRandomBytes(Constants.SALT_LEN);
byte[] passwordHash = sha.getHashWithSalt(userPasswordHash, salt);
StringBuilder buff = new StringBuilder();
buff.append("SALT '").
append(StringUtils.convertBytesToString(salt)).
append("' HASH '").
append(StringUtils.convertBytesToString(passwordHash)).