亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ent.cs

?? random generated with entropy computing
?? CS
字號:
using System;
using System.IO;
using Ent;

namespace Ent
{
	/// <summary>
	///	Apply various randomness tests to a stream of bytes	///	Original code by John Walker  --  September 1996	///	http://www.fourmilab.ch/	///		/// C# port of ENT (ent - pseudorandom number sequence test)
	/// by Brett Trotter
	/// blt@iastate.edu
	/// </summary>

	public class EntCalc
	{
		static double[,] chsqt = new double[2, 10] 			{				{0.5, 0.25, 0.1, 0.05, 0.025, 0.01, 0.005, 0.001, 0.0005, 0.0001}, 				{0.0, 0.6745, 1.2816, 1.6449, 1.9600, 2.3263, 2.5758, 3.0902, 3.2905, 3.7190}			};
		private static int MONTEN = 6;				/* Bytes used as Monte Carlo co-ordinates
													 * This should be no more bits than the mantissa 
													 * of your "double" floating point type. */

		private uint[] monte = new uint[MONTEN];		private double[] prob = new double[256];	/* Probabilities per bin for entropy */		private long[] ccount = new long[256];		/* Bins to count occurrences of values */		private long totalc = 0; 					/* Total bytes counted */		private int mp;		private bool sccfirst;		private long inmont, mcount;		private double a;		private double cexp;		private double incirc;		private double montex, montey, montepi;		private double scc, sccun, sccu0, scclast, scct1, scct2, scct3;		private double ent, chisq, datasum;		private bool binary = false;				/* Treat input as a bitstream */
		public struct EntCalcResult 
		{
			public double Entropy;
			public double ChiSquare;
			public double Mean;
			public double MonteCarloPiCalc;
			public double SerialCorrelation;
			public long[] OccuranceCount;

			public double ChiProbability;
			public double MonteCarloErrorPct;
			public double OptimumCompressionReductionPct;
			public double ExpectedMeanForRandom;

			public long NumberOfSamples;
		}

		/*  Initialise random test counters.  */		public EntCalc(bool binmode) 
		{
			int i;			binary = binmode;				/* Set binary / byte mode */			/* Initialise for calculations */			ent = 0.0;						/* Clear entropy accumulator */			chisq = 0.0;					/* Clear Chi-Square */			datasum = 0.0;					/* Clear sum of bytes for arithmetic mean */			mp = 0;							/* Reset Monte Carlo accumulator pointer */			mcount = 0;						/* Clear Monte Carlo tries */			inmont = 0;						/* Clear Monte Carlo inside count */			incirc = 65535.0 * 65535.0;		/* In-circle distance for Monte Carlo */			sccfirst = true;				/* Mark first time for serial correlation */			scct1 = scct2 = scct3 = 0.0;	/* Clear serial correlation terms */			incirc = Math.Pow(Math.Pow(256.0, (double) (MONTEN / 2)) - 1, 2.0);			for (i = 0; i < 256; i++) 
			{				ccount[i] = 0;			}			totalc = 0;		}
		/*  AddSample  --	Add one or more bytes to accumulation.	*/		public void AddSample(int buf, bool Fold)		{			AddSample((byte) buf, Fold);		}		public void AddSample(byte buf, bool Fold)		{			byte[] tmpByte = new byte[1];			tmpByte[0] = buf;			AddSample(tmpByte, Fold);		}		public void AddSample(byte[] buf, bool Fold)		{			int c, bean;			foreach(byte bufByte in buf) 
			{
				bean = 0;		// reset bean
				byte oc = bufByte;
/*	Have not implemented folding yet. Plan to use System.Text.Encoding to do so.
 * 
 *				if (fold && isISOalpha(oc) && isISOupper(oc))  *				{ *					oc = toISOlower(oc); *				} */				do 
				{					if (binary) 
					{						c = ((oc & 0x80));		// Get the MSB of the byte being read in					} 
					else 
					{						c = oc;					}					ccount[c]++;		  /* Update counter for this bin */					totalc++;					/* Update inside / outside circle counts for Monte Carlo computation of PI */					if (bean == 0) 
					{						monte[mp++] = oc;       /* Save character for Monte Carlo */						if (mp >= MONTEN) 
						{     /* Calculate every MONTEN character */							int mj;							mp = 0;							mcount++;							montex = montey = 0;							for (mj = 0; mj < MONTEN / 2; mj++) 
							{								montex = (montex * 256.0) + monte[mj];								montey = (montey * 256.0) + monte[(MONTEN / 2) + mj];							}							if ((montex * montex + montey *  montey) <= incirc) 
							{								inmont++;							}						}					}					/* Update calculation of serial correlation coefficient */					sccun = c;					if (sccfirst) 
					{						sccfirst = false;						scclast = 0;						sccu0 = sccun;					} 
					else 
					{						scct1 = scct1 + scclast * sccun;					}					scct2 = scct2 + sccun;					scct3 = scct3 + (sccun * sccun);					scclast = sccun;					oc <<= 1;						// left shift by one				} while (binary && (++bean < 8));		// keep looping if we're in binary mode and while the bean counter is less than 8 (bits)			}		}	// end foreach
		/*  EndCalculation  --	Complete calculation and return results.  */		public EntCalcResult EndCalculation()		{			int i;			/* Complete calculation of serial correlation coefficient */			scct1 = scct1 + scclast * sccu0;			scct2 = scct2 * scct2;			scc = totalc * scct3 - scct2;			if (scc == 0.0) 
			{				scc = -100000;			} 
			else 
			{				scc = (totalc * scct1 - scct2) / scc;			}			/* Scan bins and calculate probability for each bin and			   Chi-Square distribution */			cexp = totalc / (binary ? 2.0 : 256.0);  /* Expected count per bin */			for (i = 0; i < (binary ? 2 : 256); i++) 
			{				prob[i] = (double) ccount[i] / totalc;				a = ccount[i] - cexp;				chisq = chisq + (a * a) / cexp;				datasum += ((double) i) * ccount[i];			}			/* Calculate entropy */			for (i = 0; i < (binary ? 2 : 256); i++) 
			{				if (prob[i] > 0.0) 
				{					ent += prob[i] * log2(1 / prob[i]);				}			}			/* Calculate Monte Carlo value for PI from percentage of hits			   within the circle */			montepi = 4.0 * (((double) inmont) / mcount);			/* Calculate probability of observed distribution occurring from			   the results of the Chi-Square test */			double chip = Math.Sqrt(2.0 * chisq) - Math.Sqrt(2.0 * (binary ? 1 : 255.0) - 1.0);			a = Math.Abs(chip);			for (i = 9; i >= 0; i--) 
			{				if (chsqt[1,i] < a) 
				{					break;				}			}			chip = (chip >= 0.0) ? chsqt[0,i] : 1.0 - chsqt[0,i];			double compReductionPct = ((binary ? 1 : 8) - ent) / (binary ? 1.0 : 8.0);			/* Return results */			EntCalcResult result = new EntCalcResult();			result.Entropy = ent;			result.ChiSquare = chisq;			result.ChiProbability = chip;			result.Mean = datasum / totalc;			result.ExpectedMeanForRandom = binary ? 0.5 : 127.5;			result.MonteCarloPiCalc = montepi;			result.MonteCarloErrorPct = (Math.Abs(Math.PI - montepi) / Math.PI);			result.SerialCorrelation = scc;			result.OptimumCompressionReductionPct = compReductionPct;			result.OccuranceCount = this.ccount;			result.NumberOfSamples = this.totalc;			return result;		}

		/*  LOG2  --  Calculate log to the base 2  */
		static double log2(double x)		{			return Math.Log(x, 2);		//can use this in C#		}	}
	public class EntFileCalc
	{
		public static Ent.EntCalc.EntCalcResult CalculateFile(ref System.IO.FileStream inStream)
		{
			Ent.EntCalc entCalc = new EntCalc(false);			while (inStream.Position < inStream.Length)			{				entCalc.AddSample((byte) inStream.ReadByte(), false);			}						return entCalc.EndCalculation();		}
		public static Ent.EntCalc.EntCalcResult CalculateFile(string inFileName) 
		{
			System.IO.FileStream instream = new System.IO.FileStream(inFileName,System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None);			instream.Position = 0;
			Ent.EntCalc.EntCalcResult tmpRes = CalculateFile(ref instream);
			
			instream.Close();

			return tmpRes;
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩亚洲电影在线| 国产精品久久福利| 国产三级精品视频| 亚洲大片一区二区三区| 国产精选一区二区三区| 欧美日韩你懂得| 欧美激情一二三区| 极品少妇xxxx精品少妇| 欧美色偷偷大香| 国产女人aaa级久久久级| 男男视频亚洲欧美| 欧美日韩精品欧美日韩精品一| 国产午夜精品在线观看| 七七婷婷婷婷精品国产| 欧美亚洲一区二区在线观看| 国产精品美女www爽爽爽| 国内精品在线播放| 欧美一级免费观看| 午夜精品福利视频网站| 日本韩国精品一区二区在线观看| 欧美国产精品劲爆| 国产麻豆91精品| 精品电影一区二区| 国产一区二区在线视频| 精品欧美乱码久久久久久| 三级一区在线视频先锋| 欧美日韩视频在线第一区| 国产精品久久777777| 国产精品系列在线观看| 久久色在线观看| 国产精品一区二区男女羞羞无遮挡 | 欧美精品一区二区三区很污很色的| 午夜精品福利在线| 日韩一区二区视频在线观看| 日韩精品一二三| 欧美一级精品在线| 久久不见久久见免费视频7| 欧美一级在线观看| 精品在线播放免费| 久久精品一区二区三区四区| 国产suv精品一区二区6| 中文字幕国产精品一区二区| k8久久久一区二区三区| 亚洲美女区一区| 欧美亚一区二区| 午夜精品免费在线观看| 日韩精品在线网站| 九九国产精品视频| 国产欧美日韩久久| 91高清视频在线| 蜜桃91丨九色丨蝌蚪91桃色| 国产欧美一区二区精品仙草咪| av一区二区三区在线| 亚洲最大的成人av| 欧美一区二区三区在线观看| 国产一区二区三区免费| 自拍av一区二区三区| 欧美日本一道本| 国产高清不卡一区| 亚洲欧美色图小说| 日韩精品一区二区三区中文精品 | 精品国产免费视频| 成人动漫一区二区| 亚洲一区二区欧美日韩| 国产亚洲一区二区三区在线观看| 99综合电影在线视频| 肉丝袜脚交视频一区二区| 久久精品欧美一区二区三区不卡| 色婷婷国产精品| 麻豆国产精品官网| 亚洲人成亚洲人成在线观看图片 | 99re热这里只有精品视频| 亚洲丰满少妇videoshd| 国产亚洲欧洲一区高清在线观看| 一本久久a久久精品亚洲| 久久疯狂做爰流白浆xx| 亚洲啪啪综合av一区二区三区| 日韩欧美黄色影院| 91高清在线观看| 不卡一区二区三区四区| 七七婷婷婷婷精品国产| 亚洲美女免费在线| 国产精品久久三区| 日韩欧美一级二级三级久久久| 色综合天天综合给合国产| 国产在线视视频有精品| 日本少妇一区二区| 亚洲一区自拍偷拍| 亚洲少妇屁股交4| 国产欧美一区二区精品性色 | 卡一卡二国产精品 | 国产农村妇女毛片精品久久麻豆| 91麻豆精品国产91久久久资源速度| 93久久精品日日躁夜夜躁欧美| 国产一区不卡在线| 美腿丝袜一区二区三区| 午夜成人免费电影| 亚洲第一激情av| 亚洲影院久久精品| 亚洲丝袜制服诱惑| 亚洲欧美在线aaa| 国产精品天干天干在观线| 精品国产一区二区三区久久影院| 在线成人高清不卡| 欧美色涩在线第一页| 色婷婷亚洲综合| 色狠狠av一区二区三区| eeuss影院一区二区三区| 国产精品456露脸| 国产成人精品一区二区三区四区 | 26uuu国产在线精品一区二区| 日韩美女一区二区三区四区| 日韩欧美中文字幕公布| 日韩美女主播在线视频一区二区三区| 51久久夜色精品国产麻豆| 欧美人妇做爰xxxⅹ性高电影| 欧美日韩视频在线一区二区| 欧美日韩精品一区二区三区| 欧美高清视频不卡网| 欧美精品一二三区| 日韩一卡二卡三卡| 精品国产乱码91久久久久久网站| 久久综合视频网| 国产午夜精品在线观看| 日韩伦理av电影| 亚洲综合在线五月| 日韩在线卡一卡二| 国产在线精品免费| 岛国精品在线播放| 91麻豆国产香蕉久久精品| 色哟哟国产精品免费观看| 欧美性猛片aaaaaaa做受| 8v天堂国产在线一区二区| 欧美成人一区二区三区片免费 | 在线成人av影院| 久久亚洲综合色| 综合激情成人伊人| 亚洲成人资源在线| 国产在线一区观看| 日本道色综合久久| 欧美大胆一级视频| 亚洲欧美日韩在线播放| 蜜桃在线一区二区三区| 国产.欧美.日韩| 欧美老女人在线| 国产女人aaa级久久久级 | 成人网在线免费视频| 色狠狠综合天天综合综合| 日韩视频一区二区| 欧美国产精品专区| 日韩精品91亚洲二区在线观看 | 久久精品亚洲精品国产欧美| 亚洲精品va在线观看| 久久精品国产精品亚洲红杏| 成人性生交大片免费看中文| 欧美日韩国产天堂| 日本一区二区三区四区在线视频| 亚洲观看高清完整版在线观看 | 久久精品久久99精品久久| 99视频有精品| 26uuu亚洲综合色| 午夜av电影一区| 91网站最新地址| 久久尤物电影视频在线观看| 亚洲国产日日夜夜| 国产91丝袜在线18| 日韩女优av电影在线观看| 一区二区三区加勒比av| 国产麻豆成人精品| 日韩视频不卡中文| 一区二区三区日韩在线观看| 国产精品一区二区男女羞羞无遮挡 | 成人av在线影院| 日韩片之四级片| 亚洲狠狠爱一区二区三区| 成人免费av在线| 精品国产成人系列| 日韩精品乱码免费| 欧美亚一区二区| 一区二区三区在线影院| 床上的激情91.| 久久婷婷色综合| 美女脱光内衣内裤视频久久网站| 日本乱人伦一区| 综合欧美亚洲日本| 福利一区福利二区| 国产人妖乱国产精品人妖| 久久国产精品免费| 精品盗摄一区二区三区| 久久精品免费观看| 精品少妇一区二区三区视频免付费| 天天色综合天天| 91精品婷婷国产综合久久性色| 亚洲第一主播视频| 欧美日韩国产乱码电影| 亚洲观看高清完整版在线观看| 欧美日韩一级黄| 日韩精品一级二级 | 欧美伊人久久大香线蕉综合69| 一区二区三区日韩欧美精品|