Skip to content

Instantly share code, notes, and snippets.

View Coding-Enthusiast's full-sized avatar
:atom:
Busy Busy Busy

Coding Enthusiast Coding-Enthusiast

:atom:
Busy Busy Busy
  • Autarkysoft
View GitHub Profile
@Coding-Enthusiast
Coding-Enthusiast / CustomNestedLoop.cs
Last active August 25, 2016 18:40
Nested loop with variable number of loops and variable lengths
//we have a List<int> SuperList that is generated seperately and
// contains the number of loops and their lengths e.g. {3, 5, 2}
//and our loop should be like this:
//for (int i = 0; i < 3; i++)
// for (int j = 0; j < 5; j++)
// for (int k = 0; k < 2; k++)
// //use i, j, k in a function
List<int> SuperList = new List<int>();
int max = 1;
@Coding-Enthusiast
Coding-Enthusiast / Guess My Bitcoin.cs
Last active September 18, 2016 12:33
Guess My Bitcoin, creating the keyArray using C#
theKey[0] = new PKeyChar('5');//5
theKey[1] = new PKeyChar('J');//Steve Jobs
theKey[2] = new PKeyChar('k');//kevlar
theKey[3] = new PKeyChar(new char[] { 'P', '3' });//Pi, 3.14
theKey[4] = new PKeyChar('A');//Atari
theKey[5] = new PKeyChar('p');//parachute
theKey[6] = new PKeyChar('j');//Jet, F16, Mig
theKey[7] = new PKeyChar('w');//wing from the previous pic
theKey[8] = new PKeyChar('G');//Gutenberg
theKey[9] = new PKeyChar('Y');//Yo-Yo
<Window x:Class="TestIconvert.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:TestIconvert"
Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
<vm:MainWindowViewModel/>
</Window.DataContext>
<Window.Resources>
<vm:CustomConverter x:Key="myConverter"/>
@Coding-Enthusiast
Coding-Enthusiast / InpcBase.cs
Created April 29, 2017 15:47
Base class for MVVM
public class InpcBase : INotifyPropertyChanged
{
public InpcBase()
{
PropertyDependencyMap = new Dictionary<string, List<string>>();
foreach (var property in GetType().GetProperties())
{
var attributes = property.GetCustomAttributes<DependsOnPropertyAttribute>();
foreach (var dependsAttr in attributes)
@Coding-Enthusiast
Coding-Enthusiast / Fibonachi.cs
Last active August 30, 2017 01:27
Find the closest Fibonacci number
using System;
using System.Collections.Generic;
namespace Fibonachi
{
class Program
{
static void Main(string[] args)
{
Console.Write("Number: ");
@Coding-Enthusiast
Coding-Enthusiast / MiniPrivateKey.cs
Created November 23, 2018 04:39
MiniPrivateKey class from CryptoCurrency.Net library.
using CryptoCurrency.Net.Coins;
using CryptoCurrency.Net.Extensions;
using CryptoCurrency.Net.Hashing;
using System;
using System.Linq;
using System.Text;
namespace CryptoCurrency.Net.KeyPairs
{
/// <summary>
@Coding-Enthusiast
Coding-Enthusiast / Schnorr.cs
Last active February 21, 2019 07:33
Schnorr signatures using MuSig and the simple collective signature proposed for Ed25519 before
using Autarkysoft.Cryptocurrency; // Library not public yet!
using Autarkysoft.Cryptocurrency.Coins;
using Autarkysoft.Cryptocurrency.Cryptography.Asymmetric.EllipticCurve;
using Autarkysoft.Cryptocurrency.Cryptography.Hashing;
using Autarkysoft.Cryptocurrency.Extensions;
using Autarkysoft.Cryptocurrency.KeyPairs;
using System;
using System.Numerics;
namespace TestLibrary
@Coding-Enthusiast
Coding-Enthusiast / Sha512.cs
Created May 8, 2019 06:16
Unsafe implementation of some hash functions
using System;
using System.Runtime.CompilerServices;
namespace Autarkysoft.Cryptocurrency.Cryptography.Hashing
{
/// <summary>
/// https://tools.ietf.org/html/rfc6234
/// </summary>
public class Sha512 : IHashFunction, IDisposable
{
@Coding-Enthusiast
Coding-Enthusiast / AddressPlayground.cs
Created June 8, 2020 15:46
Showcase bitcoin address creation using any script
using Autarkysoft.Bitcoin;
using Autarkysoft.Bitcoin.Blockchain;
using Autarkysoft.Bitcoin.Blockchain.Scripts;
using Autarkysoft.Bitcoin.Blockchain.Scripts.Operations;
using Autarkysoft.Bitcoin.Cryptography.Asymmetric.KeyPairs;
using Autarkysoft.Bitcoin.Cryptography.Hashing;
using Autarkysoft.Bitcoin.Encoders;
public class AddressPlayground
{
@Coding-Enthusiast
Coding-Enthusiast / gist:8339f64c736053107f0d918675c186e0
Created August 30, 2020 05:01
515 valid keys are recovered from a WIF missing 7 chars
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc13VAyRT
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc15Lpsww
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc1GjcJ1z
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc1JmgZj1
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc1TgSYfK
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc1YH8BhJ
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc1eGCVAm
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc1oGcLBe
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc1u5JfVe
5KMWmYkn5YWkJnUDG4utD9L1HXQv3DBseqqCGsQXmthc218erjy