예제 #1
0
        private static void EstimateQuality(CommandLineArgs args)
        {
            string str = args[ParamText];

            if (string.IsNullOrEmpty(str))
            {
                Console.WriteLine("0");
                return;
            }

            try
            {
                ResourceManager rm     = KeePass.Program.Resources;
                byte[]          pbData = (byte[])rm.GetObject("MostPopularPasswords");
                if (pbData != null)
                {
                    PopularPasswords.Add(pbData, true);
                }
                else
                {
                    Debug.Assert(false);
                }
            }
            catch (Exception) { Debug.Assert(false); return; }

            uint uBits = QualityEstimation.EstimatePasswordBits(
                str.ToCharArray());

            Console.WriteLine(uBits);
        }