This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Security.Cryptography; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
namespace CookieSessionStateDemo.Controllers | |
{ | |
public static class InMemoryDataStore | |
{ | |
public static readonly Dictionary<string, string> UserSessions = new(); | |
public static readonly Dictionary<string, string> UserCredentials = new() { { "user1", "password1" }, { "user2", "password2" } }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$inputString = "Password123" | |
$sha256 = [System.Security.Cryptography.SHA256]::Create() | |
$bytes = [System.Text.Encoding]::UTF8.GetBytes($inputString) | |
$hashBytes = $sha256.ComputeHash($bytes) | |
$base64String = [System.Convert]::ToBase64String($hashBytes) | |
$binaryString = [System.Text.StringBuilder]::new() | |
foreach ($byte in $hashBytes) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
using Microsoft.Extensions.Primitives; | |
using Microsoft.Net.Http.Headers; | |
var app = WebApplication.Create(args); | |
string validUsername = "user1"; | |
string validPassword = "password123"; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Enis.Domain.Abstractions.StartupServices; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
public interface IConnectionStringBuilder | |
{ | |
string GetApplicationConnectionString(); | |
} | |
public class ConnectionStringBuilder : IConnectionStringBuilder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IAnalyticsHttpWrapper | |
{ | |
Task<T> GetAsynchronous<T>(string path); | |
} | |
public class AnalyticsHttpWrapper : IAnalyticsHttpWrapper | |
{ | |
private readonly IHttpClientFactory _httpClientFactory; | |
private readonly string _httpClientName; | |
private readonly HttpClient _httpClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# plumber_asynchronous.R | |
require(future) | |
require(uuid) | |
plan(multiprocess) | |
defaultPackages <- c("plyr", | |
"dplyr", | |
"dbplyr", |