BitCoinClient.Program.RandomSeed C# (CSharp) Method

RandomSeed() public static method

public static RandomSeed ( ) : void
return void
        public static void RandomSeed()
        {
            long counter;
            Win32Wrapper.QueryPerformanceCounter(out counter);
            MemoryStream stream = new MemoryStream();
            BinaryWriter bw = new BinaryWriter(stream);
            bw.Write(counter);
            byte[] data = stream.ToArray();
            //OpenSSL.RAND_add(data, data.Length, 1.5);
            OpenSSL.Core.Random.Add(data, 1.5);
            bw.Close();
        }

Usage Example

Example #1
0
        public Miner(Bitcoin bitcoin)
        {
            mBitcoin = bitcoin;
            Program.RandomSeed();

            mThread = new Thread(new ThreadStart(DoMining));
        }