ComponentFactory.Krypton.Ribbon.EncryptedLicense.Checksum C# (CSharp) Метод

Checksum() публичный статический Метод

Returns a four character checksum based on the given input string

This function can be used to generate a short checksum that can be embedded in a license key as ProductInfo. This allows you to tie the license key to information supplied by the user (for instance the name of the purchaser) without having to include the full information in the license key. This enables license keys to be kept reasonably short.

When the license is checked by the application it performs a checksum on the information supplied by the user and checks that it matches the information in the ProductInfo that was generated when the license was issued. The License Tracker application provides support for "CustomGenerators" which allow you provide the code to generate the ProductInfo from customer and other information.

public static Checksum ( string input ) : string
input string The input string to return a checksum for
Результат string
        public static string Checksum(string input)
        {
            int hash = (input == null) ? 0 : input.GetHashCode();
            hash = Math.Abs(hash % 1000);
            return hash.ToString();
        }