This file contains 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.Text; | |
using System.Threading.Tasks; | |
using BenchmarkDotNet.Attributes; | |
namespace ConsoleApplication2 | |
{ | |
public class ListPerformance |
This file contains 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 BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Diagnostics.Windows; | |
using BenchmarkDotNet.Exporters; | |
using BenchmarkDotNet.Running; | |
namespace ConsoleApplication1 |
This file contains 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
// don't actually use this - it is horrid to manage. Rather use: https://gist.github.com/rmaclean/c62ce41e92df7f7f504d | |
var checkbit = Convert.ToInt32((parts.Where((value, index) => index % 2 == 0 && index < 11).Sum()) + ((parts.Skip(1).Where((value, index) => index % 2 == 0 && index < 12).Sum() * 2).ToString(CultureInfo.InvariantCulture).Select(_ => Convert.ToInt32(_)).Sum()).ToString(CultureInfo.InvariantCulture).Last()); | |
return checkbit == 0 ? 0 : 10 - checkbit; |
This file contains 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
private static int CheckBitCalculator(int[] parts) | |
{ | |
var checkPart1 = 0; | |
var checkPart2 = string.Empty; | |
var checkPart3 = string.Empty; | |
var checkPart4 = 0; | |
var checkPart5 = string.Empty; | |
var checkPart6 = 0; | |
var checkPart7 = 0; |