ArmRest.Controllers.AccountController.RandomOAuthStateGenerator.Generate C# (CSharp) Метод

Generate() публичный статический Метод

public static Generate ( int strengthInBits ) : string
strengthInBits int
Результат string
            public static string Generate(int strengthInBits)
            {
                const int bitsPerByte = 8;

                if (strengthInBits % bitsPerByte != 0)
                {
                    throw new ArgumentException("strengthInBits must be evenly divisible by 8.", "strengthInBits");
                }

                int strengthInBytes = strengthInBits / bitsPerByte;

                byte[] data = new byte[strengthInBytes];
                _random.GetBytes(data);
                return HttpServerUtility.UrlTokenEncode(data);
            }
        }
AccountController.RandomOAuthStateGenerator