Beispiel #1
0
            public static string GetInnerAuthKey(string suid, string authorizedCode)
            {
                //suid默认 2位英文8位数字
                string cLetter = "DU";
                string cNumber = suid;

                //使用34进制  转 2进制
                if (!string.IsNullOrEmpty(cLetter))
                {
                    cLetter = FeelTheBase.X2X(cLetter, 34, 2);
                }

                //使用 11进制 转 2进制
                if (!string.IsNullOrEmpty(cNumber))
                {
                    cNumber = Text.Format("{0}{1}", cNumber, authorizedCode);

                    cNumber = FeelTheBase.X2X(cNumber, 11, 2);
                }

                string secStr = Text.Format("{0}{1}", cLetter, cNumber);

                //转换后的2进制 转 33进制
                string thrStr = FeelTheBase.X2X(secStr, 2, 33);

                //获取校验码
                return(thrStr);
            }
Beispiel #2
0
            public static string GenerteAuthKey(string suid, string authorizedCode)
            {
                //suid默认 2位英文8位数字
                string cLetter = "DU";
                string cNumber = suid;

                //使用34进制  转 2进制
                if (!string.IsNullOrEmpty(cLetter))
                {
                    cLetter = FeelTheBase.X2X(cLetter, 34, 2);
                }

                //使用 11进制 转 2进制
                if (!string.IsNullOrEmpty(cNumber))
                {
                    cNumber = Text.Format("{0}{1}", cNumber, authorizedCode);

                    cNumber = FeelTheBase.X2X(cNumber, 11, 2);
                }

                string secStr = Text.Format("{0}{1}", cLetter, cNumber);

                //转换后的2进制 转 33进制
                string thrStr = FeelTheBase.X2X(secStr, 2, 33);

                string validStr = Converter.StringToASCII(thrStr, "AZZZZZ");

                //获取校验码
                return(Text.Format("{0}{1}", validStr.Substring(0, 2), thrStr));
            }