Пример #1
0
        /// <summary>
        /// Calculate new signature
        /// </summary>
        /// <returns></returns>
        public string CalculateSignature()
        {
            ulong chs = (ulong)((Id * 123456789) - space_size_pg * 3 + extension_pg * 5 - page_size_kb * 7 + partitions * 9 - VSLib.ConvertStringToByte(CONFIG.ste)[0]);

            byte[] x = VSLib.ConvertStringToByte(indexspace.Trim().ToLower());
            for (int i = 0; i < x.Length; i++)
            {
                chs += (ulong)(x[i] * 3);
            }

            x = VSLib.ConvertStringToByte(name.Trim().ToLower());
            for (int i = 0; i < x.Length; i++)
            {
                chs += (ulong)(x[i] * 5);
            }

            signature = VSLib.ConvertULongToHexString(chs);
            return(signature);
        }