⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reed6.java

📁 著名IDAutomation公司的JAVA条码控件源码
💻 JAVA
字号:
//*****************************************************************
// 
//  JAVA Source for com.idautomation.maxicode; 4.10
//  
//  Copyright, IDAutomation.com, Inc. 2000-2004. 
//  All rights reserved.
//  
//  http://www.IDAutomation.com/java/
//  
//  NOTICE:
//  You may incorporate our Source Code in your application
//  only if you own a valid Java Developer License
//  from IDAutomation.com, Inc. and the copyright notices 
//  are not removed from the source code.
//  
//*****************************************************************

package com.idautomation.barcode.maxicode;

public class reed6

{



static final short gfi[] = {1,2,4,8,16,32,3,6,12,24,48,35,5,10,20,40,19,38,15,30,60,59,53,41,17,34,7,14,28,56,51,37,9,18,36,11,22,44,27,54,47,29,58,55,45,25,50,39,13,26,52,43,21,42,23,46,31,62,63,61,57,49,33,0};
static final short gflog[] = {0,0,1,6,2,12,7,26,3,32,13,35,8,48,27,18,4,24,33,16,14,52,36,54,9,45,49,38,28,41,19,56,5,62,25,11,34,31,17,47,15,23,53,51,37,44,55,40,10,61,46,30,50,22,39,43,29,60,42,21,20,59,57,58};

    static int K;

    public int N = 63;

	static int[] p;

// polynomials generator

static final int[]p10={31,28,39,42,57,2,3,49,44,46};
static final int[]p20= {23,44,11,33,27,8,22,37,57,36,15,48,22,17,38,33,31,19,23,59};
static final int[]p28= {22,45,53,10,41,55,35,10,22,29,23,13,61,45,34,55,40,37,46,49,34,41,9,43,7,20,11,28};



private int mult(int a, int b)
{
  int sum_log=0;
  if (a == 0 || b == 0) return 0;

  sum_log = gflog[a] + gflog[b];
  if (sum_log >= N) sum_log -= (N); // or N-1?

  return gfi[sum_log];

}


 public  void calcRS(int[] data,int k,int t2)
    {

	     setpolynomial(t2);

        for(int i = k; i < (k+t2); i++)
            data[i] = 0;

        for(int i = 0; i < k; i++)
        {
            int tmp = (short)(data[k] ^ data[i]);
			for(int j = 0; j < t2; j++) {
			    //System.out.println(""+j);
                data[k + j] = (short)(data[k + j + 1] ^ mult(tmp, p[j]));
			}

            data[k+t2-1] = mult(tmp, p[t2-1]);
        }

    }






    public void setpolynomial(int t2)

    {


       p=p10;
	   if (t2==10) p=p10;
	   if (t2==20) p=p20;
	   if (t2==28) p=p28;


    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -