程序包 org.anyline.util

类 VerifyCodeUtil

java.lang.Object
org.anyline.util.VerifyCodeUtil

public class VerifyCodeUtil extends Object
  • 字段详细资料

  • 构造器详细资料

    • VerifyCodeUtil

      public VerifyCodeUtil()
  • 方法详细资料

    • getRandomCode

      public static String getRandomCode(int len)
      使用系统默认字符源生成验证码
      参数:
      len - 验证码长度
      返回:
      String
    • getRandomCode

      public static String getRandomCode(int verifySize, String sources)
      使用指定源生成验证码
      参数:
      verifySize - 验证码长度
      sources - 验证码字符源
      返回:
      String
    • outputVerifyImage

      public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException
      生成随机验证码文件, 并返回验证码值
      参数:
      w - w
      h - h
      outputFile - outputFile
      verifySize - verifySize
      返回:
      String
      抛出:
      IOException - IOException
    • outputVerifyImage

      public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize, boolean trouble) throws IOException
      输出随机验证码图片流, 并返回验证码值
      参数:
      w - w
      h - h
      os - os
      verifySize - verifySize
      trouble - trouble
      返回:
      String
      抛出:
      IOException - IOException
    • outputVerifyImage

      public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException
      抛出:
      IOException
    • outputVerifyImageFormula

      public static String outputVerifyImageFormula(int w, int h, OutputStream os) throws IOException
      输出计算公式
      参数:
      w - w
      h - h
      os - os
      返回:
      String
      抛出:
      IOException - IOException
    • outputImage

      public static void outputImage(int w, int h, File outputFile, String code) throws IOException
      生成指定验证码图像文件
      参数:
      w - w
      h - h
      outputFile - outputFile
      code - code
      抛出:
      IOException - IOException
    • createImage

      public static BufferedImage createImage(String code, int w, int h)
    • createImage

      public static BufferedImage createImage(String code, int w, int h, boolean trouble)
    • outputImage

      public static void outputImage(int w, int h, OutputStream os, String code) throws IOException
      抛出:
      IOException
    • outputImage

      public static void outputImage(int w, int h, OutputStream os, String code, boolean trouble) throws IOException
      抛出:
      IOException
    • createBase64

      public static String createBase64(int w, int h, String code, boolean trouble) throws IOException
      抛出:
      IOException