IoT CAS Frameworks/IOT_Server/License_Framework/LicenseKeyGenerator/src/com/prokosha/licensekeygenerator/GA_CreateKeys1.java
static StringBuffer Append_CRC(StringBuffer sztemp1Buffer, int iCRC,
			int size) {
		Integer ICRC = new Integer(iCRC);
		System.out.println("In Append_CRC method ICRC is :" + ICRC);

		String abc = ICRC.toString();
		int aln = abc.length();

		StringBuffer sztempStringBuffer = new StringBuffer();
		sztempStringBuffer.setLength(size);

		StringBuffer tempCRCBuffer = new StringBuffer();
		tempCRCBuffer.setLength(size);

		for (int ch = 0; ch < aln; ch++) {
			char ac = abc.charAt(ch);
			sztempStringBuffer.setCharAt(ch, ac);
		}
		System.out.println("In Append_CRC method sztempStringBuffer is :"
				+ sztempStringBuffer);

		sztempStringBuffer.setLength(aln);
		if (sztempStringBuffer.length() < 2) {
			int c = XXX_Pad_Leading_Zeros(sztempStringBuffer, 2);
		}

		String sXYZ = sztempStringBuffer.toString();
		int iLENGTH = sXYZ.length();
		char cCHAR;
		for (int ch = 0; ch < iLENGTH; ch++) {
			cCHAR = sXYZ.charAt(ch);
			tempCRCBuffer.setCharAt(ch, cCHAR);
		}
		System.out.println("In Append_CRC method tempCRCBuffer is :"
				+ tempCRCBuffer);

		String xyz = sztemp1Buffer.toString();
		int ilength = xyz.length();
		char cac;
		for (int ch = 0; ch < ilength; ch++) {
			cac = xyz.charAt(ch);
			int intik = (int) cac;
			if ((intik <= 47) || (intik >= 91 && intik <= 96)
					|| (intik >= 58 && intik <= 64) || (intik >= 123))
				continue;

			tempCRCBuffer.setCharAt(ch + 2, cac);
		}
		System.out.println("In Append_CRC method tempCRCBuffer is :"
				+ tempCRCBuffer);
		return tempCRCBuffer;
	}
// This method append 2 digits to our key every time when we are calling
This method append 2 digits to our key every time when we are calling
This method append 2 digits to our key every time when we are calling
static StringBuffer Append_CRC(StringBuffer sztemp1Buffer, int iCRC,
			int size) {
		Integer ICRC = new Integer(iCRC);
		System.out.println("In Append_CRC method ICRC is :" + ICRC);
		String abc = ICRC.toString();
		int aln = abc.length();
		StringBuffer sztempStringBuffer = new StringBuffer();
		sztempStringBuffer.setLength(size);
		StringBuffer tempCRCBuffer = new StringBuffer();
		tempCRCBuffer.setLength(size);
		for (int ch = 0; ch < aln; ch++) {
			char ac = abc.charAt(ch);
			sztempStringBuffer.setCharAt(ch, ac);
		}
		System.out.println("In Append_CRC method sztempStringBuffer is :"
				+ sztempStringBuffer);
		sztempStringBuffer.setLength(aln);
		if (sztempStringBuffer.length() < 2) {
			int c = XXX_Pad_Leading_Zeros(sztempStringBuffer, 2);
		}
		String sXYZ = sztempStringBuffer.toString();
		int iLENGTH = sXYZ.length();
		char cCHAR;
		for (int ch = 0; ch < iLENGTH; ch++) {
			cCHAR = sXYZ.charAt(ch);
			tempCRCBuffer.setCharAt(ch, cCHAR);
		}
		System.out.println("In Append_CRC method tempCRCBuffer is :"
				+ tempCRCBuffer);
		String xyz = sztemp1Buffer.toString();
		int ilength = xyz.length();
		char cac;
		for (int ch = 0; ch < ilength; ch++) {
			cac = xyz.charAt(ch);
			int intik = (int) cac;
			if ((intik <= 47) || (intik >= 91 && intik <= 96)
					|| (intik >= 58 && intik <= 64) || (intik >= 123))
				continue;
			tempCRCBuffer.setCharAt(ch + 2, cac);
		}
		System.out.println("In Append_CRC method tempCRCBuffer is :"
				+ tempCRCBuffer);
		return tempCRCBuffer;
	}
static StringBuffer Append_CRC ( StringBuffer sztemp1Buffer , int iCRC , int size ) { Integer ICRC = new Integer ( iCRC ) ; System . out . println ( "In Append_CRC method ICRC is :" + ICRC ) ; String abc = ICRC . toString ( ) ; int aln = abc . length ( ) ; StringBuffer sztempStringBuffer = new StringBuffer ( ) ; sztempStringBuffer . setLength ( size ) ; StringBuffer tempCRCBuffer = new StringBuffer ( ) ; tempCRCBuffer . setLength ( size ) ; for ( int ch = 0 ; ch < aln ; ch ++ ) { char ac = abc . charAt ( ch ) ; sztempStringBuffer . setCharAt ( ch , ac ) ; } System . out . println ( "In Append_CRC method sztempStringBuffer is :" + sztempStringBuffer ) ; sztempStringBuffer . setLength ( aln ) ; if ( sztempStringBuffer . length ( ) < 2 ) { int c = XXX_Pad_Leading_Zeros ( sztempStringBuffer , 2 ) ; } String sXYZ = sztempStringBuffer . toString ( ) ; int iLENGTH = sXYZ . length ( ) ; char cCHAR ; for ( int ch = 0 ; ch < iLENGTH ; ch ++ ) { cCHAR = sXYZ . charAt ( ch ) ; tempCRCBuffer . setCharAt ( ch , cCHAR ) ; } System . out . println ( "In Append_CRC method tempCRCBuffer is :" + tempCRCBuffer ) ; String xyz = sztemp1Buffer . toString ( ) ; int ilength = xyz . length ( ) ; char cac ; for ( int ch = 0 ; ch < ilength ; ch ++ ) { cac = xyz . charAt ( ch ) ; int intik = ( int ) cac ; if ( ( intik <= 47 ) || ( intik >= 91 && intik <= 96 ) || ( intik >= 58 && intik <= 64 ) || ( intik >= 123 ) ) continue ; tempCRCBuffer . setCharAt ( ch + 2 , cac ) ; } System . out . println ( "In Append_CRC method tempCRCBuffer is :" + tempCRCBuffer ) ; return tempCRCBuffer ; }
This method append 2 digits to our key every time when we are calling
This method append 2 digits to our key every time when we are calling