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
ECCurve curve = ECCurve.NamedCurves.nistP256; | |
HashAlgorithmName hashName = HashAlgorithmName.SHA256; | |
// Generate ECC Key | |
byte[] x, y, d; | |
{ | |
using ECDiffieHellman ecc = ECDiffieHellman.Create(); | |
//using ECDsa ecc = ECDsa.Create(); | |
ecc.GenerateKey(curve); | |
ECParameters ecParams = ecc.ExportParameters(includePrivateParameters: true); |
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
#nullable enable | |
using System; | |
using Newtonsoft.Json.Linq; | |
namespace Commons { | |
/// <summary> | |
/// JSON Merge Patch (RFC 7396) を行うクラス。 | |
/// <para>see https://tools.ietf.org/html/rfc7396</para> |
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
namespace Inasync { | |
internal struct DirtableValue<T> { | |
private T _value; | |
public DirtableValue(T initial) : this() { | |
_value = initial; | |
} | |
public T Value { |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
namespace Commons { | |
public static class CsvSerializer { | |
public static CsvSerializer<T> Create<T>(IEnumerable<(string name, Func<T, object?> valueSelector)>? columns = null) { |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
namespace Commons { | |
public class CsvReader : IDisposable { | |
private readonly TextReader _reader; | |
private readonly List<string> _record = new(); |
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; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.Linq; | |
using System.Reflection; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Commons { |
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; | |
using System.Threading.Tasks; | |
namespace Inasync { | |
public sealed class AsyncDisposable<T> : IAsyncDisposable { | |
private readonly Func<ValueTask> _disposeAsync; | |
public AsyncDisposable(T value, Func<ValueTask> disposeAsync) { | |
Value = value; |
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; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Channels; | |
using System.Threading.Tasks; | |
namespace Commons { | |
/// <summary> | |
/// サブスクライブの <c>await</c> とキャンセルが可能な Observable インターフェース。 |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace Inasync { | |
public static class TaskHelper { | |
public static Task WhenAll(ICollection<Task> source) { |
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; | |
using System.Collections.Concurrent; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Channels; | |
using System.Threading.Tasks; | |
using Amazon.Kinesis; | |
using Amazon.Kinesis.Model; | |
namespace KinesisHelpers { |