Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Added support for GetChunk, GetFile, SendKeyspace, and GetTask (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
unclesp1d3r authored Jul 25, 2023
1 parent ed15943 commit 5c3998c
Show file tree
Hide file tree
Showing 67 changed files with 21,113 additions and 554 deletions.
4 changes: 2 additions & 2 deletions HashSlinger.Shared/Generated/ChunkDto.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public partial record ChunkDto
public DateTime DispatchTime { get; set; }
public int Id { get; set; }
public ulong Length { get; set; }
public int? Progress { get; set; }
public float? Progress { get; set; }
public ulong Skip { get; set; }
public DateTime SolveTime { get; set; }
public ulong Speed { get; set; }
public int State { get; set; }
public string State { get; set; }
public int TaskId { get; set; }
}
}
6 changes: 3 additions & 3 deletions HashSlinger.Shared/Generated/FileDto.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public partial record FileDto
public int AccessGroupId { get; set; }
public Guid? FileGuid { get; set; }
public string FileName { get; set; }
public int FileType { get; set; }
public string FileType { get; set; }
public int Id { get; set; }
public bool IsSecret { get; set; }
public long? LineCount { get; set; }
public long Size { get; set; }
public int? LineCount { get; set; }
public int Size { get; set; }
}
}
2 changes: 1 addition & 1 deletion HashSlinger.Shared/Generated/TaskDto.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public partial record TaskDto
public string? PreprocessorCommand { get; set; }
public int Priority { get; set; }
public ulong SkipKeyspace { get; set; }
public int StaticChunks { get; set; }
public string StaticChunks { get; set; }
public int StatusTimer { get; set; }
public int TaskWrapperId { get; set; }
public bool UseNewBenchmark { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion HashSlinger.Shared/Generated/TaskWrapperDto.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public partial record TaskWrapperDto
public bool IsArchived { get; set; }
public string Name { get; set; }
public int Priority { get; set; }
public int TaskType { get; set; }
public string TaskType { get; set; }
}
}
6 changes: 4 additions & 2 deletions HashSlinger.Shared/Models/Chunk.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace HashSlinger.Shared.Models;

using Enums;

/// <summary>A chunk of a cracking task.</summary>
/// <autogeneratedoc />
public record Chunk
Expand Down Expand Up @@ -61,7 +63,7 @@ public record Chunk
/// <summary>Gets or sets the progress.</summary>
/// <value>The progress.</value>
/// <autogeneratedoc />
public int? Progress { get; set; }
public float? Progress { get; set; }

/// <summary>Gets or sets the skip.</summary>
/// <value>The skip.</value>
Expand All @@ -81,7 +83,7 @@ public record Chunk
/// <summary>Gets or sets the state.</summary>
/// <value>The state.</value>
/// <autogeneratedoc />
public int State { get; set; }
public ChunkState State { get; set; }

/// <summary>Gets or sets the task identifier.</summary>
/// <value>The task identifier.</value>
Expand Down
16 changes: 16 additions & 0 deletions HashSlinger.Shared/Models/Enums/ChunkState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace HashSlinger.Shared.Models.Enums;

public enum ChunkState
{
Init,
Autotune,
Running,
Paused,
Exhausted,
Cracked,
Aborted,
Quit,
Bypass,
AbortedCheckpoint,
StatusAbortedRuntime
}
6 changes: 6 additions & 0 deletions HashSlinger.Shared/Models/Enums/FileType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace HashSlinger.Shared.Models.Enums;

/// <summary>
/// Represents a file type.
/// </summary>
public enum FileType { WordList = 1, Rule = 2, HashList = 3, Mask = 4 }
3 changes: 3 additions & 0 deletions HashSlinger.Shared/Models/Enums/TaskStaticChunking.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace HashSlinger.Shared.Models.Enums;

public enum TaskStaticChunking { Normal, ChunkSize, NumberOfChunks }
3 changes: 3 additions & 0 deletions HashSlinger.Shared/Models/Enums/TaskType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace HashSlinger.Shared.Models.Enums;

public enum TaskType { Normal, SuperTask }
7 changes: 4 additions & 3 deletions HashSlinger.Shared/Models/File.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace HashSlinger.Shared.Models;

using System.ComponentModel.DataAnnotations;
using Enums;

/// <summary>Represents a file.</summary>
/// <autogeneratedoc />
Expand Down Expand Up @@ -44,7 +45,7 @@ public record File
/// <summary>Gets or sets the type of the file.</summary>
/// <value>The type of the file.</value>
/// <autogeneratedoc />
public int FileType { get; set; }
public FileType FileType { get; set; }

/// <summary>Gets or sets the identifier.</summary>
/// <value>The identifier.</value>
Expand All @@ -59,10 +60,10 @@ public record File
/// <summary>Gets or sets the line count.</summary>
/// <value>The line count.</value>
/// <autogeneratedoc />
public long? LineCount { get; set; }
public int? LineCount { get; set; }

/// <summary>Gets or sets the size.</summary>
/// <value>The size, in bytes.</value>
/// <autogeneratedoc />
public long Size { get; set; }
public int Size { get; set; }
}
9 changes: 5 additions & 4 deletions HashSlinger.Shared/Models/Task.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace HashSlinger.Shared.Models;

using System.ComponentModel.DataAnnotations;
using Enums;

/// <summary>Represents a cracking task.</summary>
/// <autogeneratedoc />
Expand Down Expand Up @@ -145,10 +146,10 @@ public record Task
/// <autogeneratedoc />
public ulong SkipKeyspace { get; set; }

/// <summary>Gets or sets the number of static chunks.</summary>
/// <value>The static chunk count.</value>
/// <autogeneratedoc />
public int StaticChunks { get; set; }

/// <summary>Gets or sets the static chunk state.</summary>
/// <value>The static chunks.</value>
public TaskStaticChunking StaticChunks { get; set; }

/// <summary>Gets or sets the status timer.</summary>
/// <value>The status timer.</value>
Expand Down
3 changes: 2 additions & 1 deletion HashSlinger.Shared/Models/TaskWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace HashSlinger.Shared.Models;

using System.ComponentModel.DataAnnotations;
using Enums;

/// <summary>A wrapper object that maps a task, hashlist, and priority.</summary>
/// <autogeneratedoc />
Expand Down Expand Up @@ -61,5 +62,5 @@ public record TaskWrapper
/// <summary>Gets or sets the type of the task.</summary>
/// <value>The type of the task.</value>
/// <autogeneratedoc />
public int TaskType { get; set; }
public TaskType TaskType { get; set; }
}
69 changes: 0 additions & 69 deletions HashSlinger.Test/FileEndpointIntegrationTests.cs

This file was deleted.

6 changes: 3 additions & 3 deletions HashSlinger.Test/HashSlinger.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
Expand Down
Loading

0 comments on commit 5c3998c

Please sign in to comment.