Skip to content

Instantly share code, notes, and snippets.

View cleftheris's full-sized avatar

Constantinos Leftheris cleftheris

View GitHub Profile
@cleftheris
cleftheris / MySqlPasswordHasher.cs
Created November 15, 2018 08:41
MySQL aware password hasher for Asp.NET Identity v2 & v3
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Options;
namespace Indice.AspNetCore.Identity
{
@cleftheris
cleftheris / MySQLPasswordTests.cs
Created November 15, 2018 08:17
xUnit test demonstrating MySQL generated sha1 password hashing in c#
using System;
using System.Security.Cryptography;
using System.Text;
using Xunit;
namespace Identity.Tests
{
public class PasswordTests
{
[InlineData("test", "*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29")]
@cleftheris
cleftheris / IScheduledTask.cs
Created September 19, 2017 10:51
IScheduledTask
public interface IScheduledTask
{
string Schedule { get; }
}
@cleftheris
cleftheris / SchedulerHostedService.cs
Last active May 21, 2022 16:37
Scoped dependency resolving in SchedulerHostedService
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Scheduling.Cron;
namespace Scheduling