using System;
using System.Linq;
using System.Security.Cryptography;

namespace VCommon.Security
{
    public static class RandomStringGenerator
    {
        private static readonly RNGCryptoServiceProvider RngCryptoServiceProvider = new RNGCryptoServiceProvider();

        public static string GuidBasedRandomHexString64()
        {
            var arr1 = Guid.NewGuid().ToByteArray();
            var arr2 = new byte[16]; RngCryptoServiceProvider.GetBytes(arr2, 0, arr2.Length);
            return arr1.Zip(arr2, (x, y) => new[] { x, y }).SelectMany(p => p).Select(p => p.ToString("X2")).JoinString();
        }
    }
}