v2client/src/main/java/com/yubico/client/v2/YubicoClient.java
public static boolean isValidOTPFormat(String otp) {
		if (otp == null){
			return false;
		}		
		int len = otp.length();
		for (char c : otp.toCharArray()) {
			if (c < 0x20 || c > 0x7E) {
				return false;
			}
		}
		return OTP_MIN_LEN <= len && len <= OTP_MAX_LEN;
	}
public static boolean isValidOTPFormat(String otp) {
		if (otp == null){
			return false;
		}		
		int len = otp.length();
		for (char c : otp.toCharArray()) {
			if (c < 0x20 || c > 0x7E) {
				return false;
			}
		}
		return OTP_MIN_LEN <= len && len <= OTP_MAX_LEN;
	}
public static boolean isValidOTPFormat ( String otp ) { if ( otp == null ) { return false ; } int len = otp . length ( ) ; for ( char c : otp . toCharArray ( ) ) { if ( c < 0x20 || c > 0x7E ) { return false ; } } return OTP_MIN_LEN <= len && len <= OTP_MAX_LEN ; }
Determines whether a given OTP is of the correct length
and only contains printable characters, as per the recommendation.

@param otp The OTP to validate
@return boolean Returns true if it's valid; false otherwise
Determines whether a given OTP is of the correct length and only contains printable characters as per the recommendation .