mirror of
https://github.com/moudey/Shell.git
synced 2026-11-16 09:04:25 +08:00
Add files via upload
This commit is contained in:
1 parent
94adc1dbc7
commit
6d256bbe92
6 files changed
+462
No files matched your search
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30611.23
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hash", "Hash\Hash.csproj", "{7B4F25A2-6A5F-4EC5-A96C-A51244F32C87}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7B4F25A2-6A5F-4EC5-A96C-A51244F32C87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7B4F25A2-6A5F-4EC5-A96C-A51244F32C87}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7B4F25A2-6A5F-4EC5-A96C-A51244F32C87}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7B4F25A2-6A5F-4EC5-A96C-A51244F32C87}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8D7015E2-893E-450A-83FD-BC0EE72D740A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Nilesoft
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Application.SetHighDpiMode(HighDpiMode.SystemAware);
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
if(args.Length == 0)
|
||||
Application.Run(new frmGroups());
|
||||
else
|
||||
{
|
||||
if(args[0] == "-compact")
|
||||
Application.Run(new frmMain());
|
||||
else //if(args[0] == "-full")
|
||||
Application.Run(new frmGroups());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,67 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Nilesoft
|
||||
{
|
||||
public static class Hash
|
||||
{
|
||||
public const ulong offset_basis_64 = 14695981039346656037U;
|
||||
public const ulong prime_64 = 1099511628211UL;
|
||||
public const uint offset_basis = 2166136261U;
|
||||
public const uint prime = 16777619U;
|
||||
|
||||
//constexpr auto
|
||||
//const uint offset_basis = 5381U;
|
||||
//const auto prime = 33U;
|
||||
|
||||
public static ulong hash64(string str)
|
||||
{
|
||||
var h = offset_basis_64;
|
||||
foreach (var c in str)
|
||||
{
|
||||
h ^= c;
|
||||
h *= prime_64;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
public static uint hash(string str)
|
||||
{
|
||||
var h = offset_basis;
|
||||
foreach (var c in str) {
|
||||
h ^= c;
|
||||
h *= prime;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
public const int Magic = 5381;
|
||||
|
||||
public static int Generate(int hash, char value)
|
||||
{
|
||||
return hash * 33 + char.ToLower(value);
|
||||
}
|
||||
|
||||
public static int Generate(string value)
|
||||
{
|
||||
string text = value.Trim();
|
||||
int num = 5381;
|
||||
int num3;
|
||||
for (int i = 0; i < text.Length; i = num3 + 1)
|
||||
{
|
||||
num = Generate(num, text[i]);
|
||||
num3 = i;
|
||||
}
|
||||
return (num != 5381) ? num : 0;
|
||||
}
|
||||
|
||||
public static string ToString(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return "0x" + $"{Generate(input):X8}U";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<Nullable>disable</Nullable>
|
||||
<TargetFramework>net9.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Binary file not shown.
Reference in new issue
Block a user