Returns an iban with replaced check digit.

@param iban The iban
@return The iban without the check digit
420577
static String replaceCheckDigit(final String iban, final String checkDigit) {
        return getCountryCode(iban) + checkDigit + getBban(iban);
    }
80875
private function isLengthValid()
    {
        $countryCode = $this->getCountryCode();
        $validLength = static::COUNTRY_CODE_LENGTH + static::CHECKSUM_LENGTH + static::$ibanFormatMap[$countryCode][0];

        return strlen($this->iban) === $validLength;
    }
509057
public static int getIbanLength(final CountryCode countryCode) {
        final BbanStructure structure = getBbanStructure(countryCode);
        return COUNTRY_CODE_LENGTH + CHECK_DIGIT_LENGTH + structure.getBbanLength();
    }
719024
public static String getDigits(String value) {

    StringBuilder digits = new StringBuilder(value.length());

    for (char chr : value.toCharArray()) {
      if (Character.isDigit(chr)) {
        digits.append(chr);
      }
    }

    return digits.toString();
  }
506291
public static function withCheckDigitForEan($ean)
    {
        // Sanitize
        $ean = (int) $ean;
        $ean = substr($ean, 0, 12);

        // Validate
        if (strlen($ean) != 12) {
            return null;
        }

        // Calculate (sum)
        $sum = 0;
        for ($i = 0; $i < 12; $i++) {
            $sum += $ean{$i} * ($i % 2 ? 3 : 1);
        }

        // Calculate (check digit)
        $checkDigit = ceil($sum / 10) * 10 - $sum;

        return $ean . $checkDigit;
    }
1359712
public BEValue bdecodeNumber() throws IOException {
    int c = this.getNextIndicator();
    if (c != 'i') {
      throw new InvalidBEncodingException("Expected 'i', not '" +
              (char) c + "'");
    }
    this.indicator = 0;

    c = this.read();
    if (c == '0') {
      c = this.read();
      if (c == 'e')
        return new BEValue(BigInteger.ZERO);
      else
        throw new InvalidBEncodingException("'e' expected after zero," +
                " not '" + (char) c + "'");
    }

    // We don't support more the 255 char big integers
    char[] chars = new char[256];
    int off = 0;

    if (c == '-') {
      c = this.read();
      if (c == '0')
        throw new InvalidBEncodingException("Negative zero not allowed");
      chars[off] = '-';
      off++;
    }

    if (c < '1' || c > '9')
      throw new InvalidBEncodingException("Invalid Integer start '"
              + (char) c + "'");
    chars[off] = (char) c;
    off++;

    c = this.read();
    int i = c - '0';
    while (i >= 0 && i <= 9) {
      chars[off] = (char) c;
      off++;
      c = read();
      i = c - '0';
    }

    if (c != 'e')
      throw new InvalidBEncodingException("Integer should end with 'e'");

    String s = new String(chars, 0, off);
    return new BEValue(new BigInteger(s));
  }
230995
public static String toFinancialCharacter(double number) {
        final String zero = String.valueOf(ValueConsts.ZERO_INT);
        String[] array = formatDecimal(number).split("\\.");
        final int len = Math.min(array[0].length(), 16);
        StringBuilder leftUpper = new StringBuilder();
        StringBuilder rightUpper = new StringBuilder();
        int reverseIndex;
        for (int i = len - 1; i >= 0; i--) {
            reverseIndex = len - i - 1;
            int idx = array[0].charAt(i) - ValueConsts.FORTY_EIGHT;
            int remainder = reverseIndex % 4;
            int res = reverseIndex / 4;
            if (remainder == 0 && res > 0) {
                leftUpper.insert(ValueConsts.ZERO_INT, RMB_INTEGER_UNIT[res]);
            }
            leftUpper.insert(ValueConsts.ZERO_INT, idx > 0 ? RMB_CHARACTERS[idx] + RMB_UNIT[remainder] : idx);
        }
        array[1] = Utils.rightTrim(array[1], zero);
        String left = Utils.rightTrim(leftUpper.toString(), zero);
        if (Checker.isEmpty(array[1])) {
            rightUpper.append("整");
        } else {
            for (int i = 0; i < array[1].length(); i++) {
                int idx = array[1].charAt(i) - ValueConsts.FORTY_EIGHT;
                if (i == 0) {
                    rightUpper.append(idx > 0 ? RMB_CHARACTERS[idx] + RMB_DECIMAL_UNIT[i] : zero);
                } else {
                    rightUpper.append(RMB_CHARACTERS[idx]).append(RMB_DECIMAL_UNIT[i]);
                }
            }
        }
        String upper = Utils.leftTrim((Checker.isEmpty(left) ? (Checker.isEmpty(rightUpper.toString()) ? zero +
                RMB_INTEGER_UNIT[0] : "") : left + RMB_INTEGER_UNIT[0]) + rightUpper, zero).replaceAll("0+", "零");
        int unitLen = (len / RMB_INTEGER_UNIT.length) + 1;
        for (int i = 1; i < unitLen; i++) {
            for (int j = i + 1; j < unitLen; j++) {
                upper = upper.replace(RMB_INTEGER_UNIT[j] + RMB_CHARACTERS[0] + RMB_INTEGER_UNIT[i],
                        RMB_INTEGER_UNIT[j]);
            }
            upper = upper.replace(RMB_CHARACTERS[0] + RMB_INTEGER_UNIT[i], RMB_INTEGER_UNIT[i] + RMB_CHARACTERS[0]);
            upper = upper.replace(RMB_INTEGER_UNIT[i] + RMB_CHARACTERS[0] + RMB_INTEGER_UNIT[0], RMB_INTEGER_UNIT[i]
                    + RMB_INTEGER_UNIT[0]);
        }
        return upper.replaceAll("零零", "零");
    }
849033
private static String matchDoneBigDecimal(String bigDecimal) {
        // 对科学计数法进行处理
        boolean flg = Pattern.matches("^-?\\d+(\\.\\d+)?(E-?\\d+)?$", bigDecimal);
        if (flg) {
            BigDecimal bd = new BigDecimal(bigDecimal);
            bigDecimal = bd.toPlainString();
        }
        return bigDecimal;
    }
828745
public static function isNationalTransaction($iban1, $iban2)
    {
        // remove whitespaces
        $iban1 = preg_replace('#\s+#','',$iban1);
        $iban2 = preg_replace('#\s+#','',$iban2);

        // check the country code
        if(stripos($iban1,substr($iban2,0,2)) === 0)
            return true;
        else
            return false;
    }
840159
public String getIntegerPartAfter(final int digit) {
        
        final int length = integerPart.length();
        if(length < digit || digit <= 0) {
            return "";
        }
        
        String num = integerPart.substring(0, (length - digit + 1));
        if(isUseSeparator() && digit >= 4) {
            // 区切り文字を入れるために分割する。
            StringBuilder sb = new StringBuilder();
            for(int i=0; i < num.length(); i++) {
                char c = num.charAt(i);
                sb.append(c);
                
                // 現在の処理中の桁数
                int itemDigit = length -i;
                if((itemDigit >= 3) && (itemDigit -1) % 3 == 0) {
                    sb.append(",");
                }
            }
            
            num = sb.toString();
        }
        
        return num;
        
    }
537953
public static String stripNonNumber(String string)
    {
    	if (string == null)
    		return null;
        for (int i = 0; i < string.length(); i++)
        {
            char ch = string.charAt(i);
            if (!(Character.isDigit(ch)))
                if (ch != gchDot)
                if (ch != gchMinus)
                {
                    string = string.substring(0, i) + string.substring(i + 1);
                    i--;
                }
        }
        return string;
    }
311634
def luhn_check(number)
      multiplications = []

      number.split(//).each_with_index do |digit, i|
        if i % 2 == 0
          multiplications << digit.to_i * 2
        else
          multiplications << digit.to_i
        end
      end

      sum = 0
      multiplications.each do |num|
        num.to_s.each_byte do |character|
          sum += character.chr.to_i
        end
      end

      if sum % 10 == 0
        control_digit = 0
      else
        control_digit = (sum / 10 + 1) * 10 - sum
      end

      control_digit.to_s
    end
857383
public @CheckForNull String checkSanity() {
        OUTER: for (int i = 0; i < 5; i++) {
            long bitMask = (i<4)?bits[i]:(long)dayOfWeek;
            for( int j=BaseParser.LOWER_BOUNDS[i]; j<=BaseParser.UPPER_BOUNDS[i]; j++ ) {
                if(!checkBits(bitMask,j)) {
                    // this rank has a sparse entry.
                    // if we have a sparse rank, one of them better be the left-most.
                    if(i>0)
                        return Messages.CronTab_do_you_really_mean_every_minute_when_you(spec, "H " + spec.substring(spec.indexOf(' ') + 1));
                    // once we find a sparse rank, upper ranks don't matter
                    break OUTER;
                }
            }
        }

        int daysOfMonth = 0;
        for (int i = 1; i < 31; i++) {
            if (checkBits(bits[2], i)) {
                daysOfMonth++;
            }
        }
        if (daysOfMonth > 5 && daysOfMonth < 28) { // a bit arbitrary
            return Messages.CronTab_short_cycles_in_the_day_of_month_field_w();
        }

        String hashified = hashify(spec);
        if (hashified != null) {
            return Messages.CronTab_spread_load_evenly_by_using_rather_than_(hashified, spec);
        }

        return null;
    }
1089211
public static void validate(final String iban) throws IbanFormatException,
            InvalidCheckDigitException, UnsupportedCountryException {
        try {
            validateEmpty(iban);
            validateCountryCode(iban);
            validateCheckDigitPresence(iban);

            final BbanStructure structure = getBbanStructure(iban);

            validateBbanLength(iban, structure);
            validateBbanEntries(iban, structure);

            validateCheckDigit(iban);
        } catch (Iban4jException e) {
            throw e;
        } catch (RuntimeException e) {
            throw new IbanFormatException(UNKNOWN, e.getMessage());
        }
    }
227154
protected static String byteToHexString(byte ib) {
		char[] Digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
		char[] ob = new char[2];
		ob[0] = Digit[(ib >>> 4) & 0X0f];
		ob[1] = Digit[ib & 0X0F];
		String s = new String(ob);
		return s;
	}
1350719
public String num2Chn(int num){
		char s[]=new char[32],ch;
		int counter1,counter2;
		int chr,preChr=-1;
		int len=0;
		boolean suffixZero=true;
		counter1=0;
		counter2=0;
		while(num>0){
			chr=num%10;
			if(chr!=0){
				suffixZero=false;
				if(counter1>0){
					s[len]=this.strUnit.charAt(counter1);
					len++;
				}
				if(num/10!=0 || counter1!=1 || chr!=1){
					s[len]=this.strDigitOut.charAt(chr);
					len++;
				}
			}
			else{
				if(!suffixZero)
					if(preChr!=0){
						s[len]=this.strDigitOut.charAt(chr);
						len++;
					}
			}
			num=num/10;
			preChr=chr;
			counter1++;
			if(counter1==4){
				counter1=0;
				counter2++;
				suffixZero=true;
				if(num%10000>0){
					s[len]=this.strUnit.charAt(3+counter2);
					len++;
				}
			}
		}
		for(int i=0;i<len/2;i++){
			ch=s[i];
			s[i]=s[len-i-1];
			s[len-i-1]=ch;
		}
		if(len==0){
			s[len]=this.strDigitOut.charAt(0);
			len++;
		}
		return new String(s,0,len);
	}
272154
public String getIntegerPart(final int digit) {
        
        final int length = integerPart.length();
        if(length < digit || digit <= 0) {
            return "";
        }
        
        String num = String.valueOf(integerPart.charAt(length - digit));
        if(isUseSeparator()) {
            if(digit >= 4 && (digit-1) % 3 == 0) {
                num += ",";
            }
        }
        
        return num;
        
    }