Example usage for org.apache.commons.validator.routines.checkdigit CheckDigit calculate

List of usage examples for org.apache.commons.validator.routines.checkdigit CheckDigit calculate

Introduction

In this page you can find the example usage for org.apache.commons.validator.routines.checkdigit CheckDigit calculate.

Prototype

public String calculate(String code) throws CheckDigitException;

Source Link

Document

Calculate the Check Digit for a code.

Usage

From source file:com.inkubator.common.util.CheckDigitLunh.java

/**
 * Calculate a number for the check digit
 * @param code/*  w  w w  .  ja  va 2 s  .c  om*/
 * @return String code of check digit
 * @throws org.apache.commons.validator.routines.checkdigit.CheckDigitException
 */
public static String calculate(String code) throws CheckDigitException {
    CheckDigit checkDigit = new LuhnCheckDigit();
    return checkDigit.calculate(code);
}