Algorithm Specifications

Below you will find our specifications for custom registration/license generation algorithms. Internally our system will support three different types of source code: ANSI C/C++, PERL, and JAVA. We recommend reading the section on PERL if you're converting from another language such as Visual Basic or Delphi. 下面您可以看到我们的客制化注册码/许可密钥的算法生成标准。我们系统内部支持三种不同的源代码:ANSI C/C++、 PERL、和JAVA。如果您打算从其他语言如Visual Basic或Delphi转换过来,我们建议您阅读PERL部分。

* All source code should be zipped up into a single file, with an included examples.txt, which provides us at least one example of correct/valid input and output.  After we compile your source, we will use this example to verify that everything is working properly.   *所有源代码应压缩成一个单独档案,档案内附加examples.txt文件,提供至少一个正确/有效的输入和输出示例。在我们编译您的源代码之后,我们将用该示例来核实一切是否正常。

C/C++ Source Code Specifications C/C++源代码标准

Submissions of C and C++ source code should be able to be compiled on an ANSI compliant compiler.  The recommended compiler for maximum compatibility with our system is gcc or g++.  C++ source must not contain any vendor specific classes such as CString, a common Microsoft Visual C++ class.  In all cases, the source should be as platform neutral as possible.  Our systems run on Solaris x86 32bit, which means that byte ordering will be the same as most widely available Intel systems.  You should try to limit your included libraries to standards such as string.h, math.h, etc. 提交的C和 C++源代码必须能够在符合ANSI标准的编译器上编译通过。我们建议的gcc或 g++是与我们系统最相容的编译器。C++不可以包含发行商自行重新定义的类,例如CString类,一个Microsoft Visual C++常用的类。在所有情况下,源码应该尽可能地不要有平台针对性。我们的系统在Solaris x86 32bit上运行,意味着字节排序与应用广泛的Intel系统是相同的。你应该尽量限定只使用标准的库文件,例如string.h、 math.h等等。

In addition to conforming to ANSI standards, another important part of a successful compile will be your main function.  All arguments will be passed through command line variables, and the source should print out the registration code only.  No additional text should be printed out.  An example main function is the following: 除了符合ANSI标准,成功通过编译的另外一个重要部分是您的main函数。所有参数都通过命令行参数来传递,而且源代码应该仅输出注册码,不应输出其他任何额外内容。main函数的示例如下:

#include <string.h>

int main(int argc, void *argv[])
   // First parameter is user's full name
   char userName[255];
   char regCode[255];

   strncpy(userName, argv[1], 255);

   // Code or function calls to
   // place registration code into
   // regCode variable

   return 0;

Please note that the example above assumes that we are passing in the customer's first and last name to the first argument.  Upon request, additional information and/or alternate information can be passed as arguments. 请注意,在以上例子中我们假设将客户的名和姓传值到第一个参数。如有需求,额外信息或其他信息都可当参数传送。

PERL Specifications PERL 标准

PERL source will tend to have maximum compatibility with our system. This is also a good choice if your algorithm is in Visual Basic, Delphi, or another language which must be converted. PERL is a relatively easy language to learn, and we recommend the PERL tutorial at PERL源代码能最大限度地与我们的系统相容,对于算法使用Visual Basic、 Delphi或其他任何必需转换的语言的人来说,PERL也是一个不错的选择。PERL是一种相对易学的语言,在perl.com上有我们推荐的PERL指南。

Source code written in PERL will be passed command line parameters accessible in the standard argument array.  The source should print out the registration information onto a single line containing only the registration code.  No other text should be included with this code.  Example PERL source code follows: PERL源代码将通过命令行经由标准参数阵列接收到参数传递,并应该输出一行仅包含注册码的注册信息,不包含其他任何文本信息。PERL源代码例子如下:


use strict;

my $userName = $ARGV[0];
my $regCode = '';

# Code, function calls, etc, to handle
# registration/license generation

print "$regCode";

JAVA Specifications JAVA标准

Submissions of JAVA source code must conform to the following specifications.  Your main "console" class should be named "CustomAlgorithm" and should not be contained in any package.  Other proprietary classes can be named and packaged however you require, and should of course be imported into the CustomAlgorithm class as necessary.  Source code is required so that any current or future changes that we need to make to the structure of the algorithms can be handled internally. 提交的JAVA源代码必须符合以下标准。您的"console"主类应该命名为"CustomAlgorithm",且不包含在任何package里面。其他的类可以按照您的要求进行命名或打包,当然也应该在有需要的情况下导入到CustomAlgorithm类中。为了在需要的时候我们能够内部处理所进行的算法结构更改,源代码是必需的。

Arguments to the program will be passed in via command line variables.  An example class would be as follows: 程序参数将通过命令行参数来传递。类的例子如下:

public class CustomAlgorithm {

  public static void main(String[] args) {
    // First parameter is user's full name

    if (args.length < 1){
    } else {
      String regCode = "";

      // Code to produce registration information


  // Other functions as necessary


Return to Main Menu