<commit_before>var arcgis = Require<ArcGISPack>();

var serverUrl = "https://localhost/arcgis";
var username= "";
var password = "";
if (String.IsNullOrEmpty(username) || String.IsNullOrEmpty(password))
{
  Console.WriteLine("Uh-oh spaghetti-o, looks like you forgot to set the user credentials.");
}
else
{
  var gateway = arcgis.CreateGateway(serverUrl, username, password);
  var token = gateway.TokenProvider.CheckGenerateToken(CancellationToken.None).Result;

  Console.WriteLine(String.Format("Token expires at {0:g}", token.Expiry.FromUnixTime().ToLocalTime()));
  Console.WriteLine(token.Value);
}<commit_msg>added encryption option and other token generation method<commit_after>var arcgis = Require<ArcGISPack>();

var serverUrl = "https://localhost/arcgis";
var username= "";
var password = "";
if (String.IsNullOrEmpty(username) || String.IsNullOrEmpty(password))
{
  Console.WriteLine("Uh-oh spaghetti-o, looks like you forgot to set the user credentials.");
}
else
{
  // Uncomment this to encrypt the token generation requests
  // arcgis.EncryptTokenRequests = true;

  // first way
  var gateway = arcgis.CreateGateway(serverUrl, username, password);
  var token = gateway.TokenProvider.CheckGenerateToken(CancellationToken.None).Result;

  Console.WriteLine(String.Format("Token expires at {0:g}", token.Expiry.FromUnixTime().ToLocalTime()));
  Console.WriteLine(token.Value);

  // second way
  var otherToken = new TokenProvider(serverUrl, username, password).CheckGenerateToken(CancellationToken.None).Result;
  Console.WriteLine(String.Format("Token expires at {0:g}", otherToken.Expiry.FromUnixTime().ToLocalTime()));
  Console.WriteLine(otherToken.Value);
}
{'fraction_non_alphanumeric': 0.1338488994646044, 'fraction_numerical': 0.001784651992861392, 'mean_word_length': 5.979253112033195, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1165473', 'n_tokens_mistral': 501, 'n_tokens_neox': 492, 'n_words': 111}