Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2022-06-14 22:18:00 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2022-06-14 22:18:00 +0300
commit8abd6a108fc3dd2c05e517f910e991a1dda8ec83 (patch)
treeea27955cf37c9636f4710c629ddbeba2fdf27ce0
parentfd0a62eb4fa0d36677760d2f08a45825f95857e6 (diff)
Removed unused key generator
-rw-r--r--Duplicati/Library/Utility/Duplicati.Library.Utility.csproj1
-rw-r--r--Duplicati/Library/Utility/KeyGenerator.cs92
2 files changed, 0 insertions, 93 deletions
diff --git a/Duplicati/Library/Utility/Duplicati.Library.Utility.csproj b/Duplicati/Library/Utility/Duplicati.Library.Utility.csproj
index 9c3a14ef3..16766daa7 100644
--- a/Duplicati/Library/Utility/Duplicati.Library.Utility.csproj
+++ b/Duplicati/Library/Utility/Duplicati.Library.Utility.csproj
@@ -52,7 +52,6 @@
<Compile Include="AsyncHttpRequest.cs" />
<Compile Include="WinTools.cs" />
<Compile Include="FilterGroups.cs" />
- <Compile Include="KeyGenerator.cs" />
<Compile Include="MD5HashHelper.cs" />
<Compile Include="OverrideableStream.cs" />
<Compile Include="ProgressReportingStream.cs" />
diff --git a/Duplicati/Library/Utility/KeyGenerator.cs b/Duplicati/Library/Utility/KeyGenerator.cs
deleted file mode 100644
index 7a42715f3..000000000
--- a/Duplicati/Library/Utility/KeyGenerator.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2015, The Duplicati Team
-// http://www.duplicati.com, info@duplicati.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Duplicati.Library.Utility
-{
- public static class KeyGenerator
- {
- public static readonly char[] ALPHA_LOWER = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
- public static readonly char[] ALPHA_UPPER = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
- public static readonly char[] DIGITS = new char[] { '0', '2', '3', '4', '5', '6', '7', '8', '9' };
- public static readonly char[] PUNCTUATION = new char[] { '.', ',', ':', ';', '!', '?' };
- public static readonly char[] MISC = new char[] { '*', '@', '#', '$', '%', '&', '/', '(', ')', '=', '+', '>', '<', '-', '_' };
-
- public static readonly char[] HEX_CHARS = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
- private static char[] _allowed = null;
- private static Random _rnd = null;
-
- public static char[] AllowedChars
- {
- get
- {
- if (_allowed == null)
- {
- List<char> l = new List<char>();
- l.AddRange(ALPHA_LOWER);
- l.AddRange(ALPHA_UPPER);
- l.AddRange(DIGITS);
- l.AddRange(PUNCTUATION);
- l.AddRange(MISC);
- _allowed = l.ToArray();
- }
-
- return _allowed;
- }
- }
-
- public static Random Rnd
- {
- get
- {
- if (_rnd == null)
- _rnd = new Random();
- return _rnd;
- }
- }
-
- public static string GenerateKey(int minChars, int maxChars)
- {
- char[] tmp = new char[Rnd.Next(minChars, maxChars + 1)];
- for (int i = 0; i < tmp.Length; i++)
- tmp[i] = AllowedChars[Rnd.Next(0, AllowedChars.Length)];
-
- return new string(tmp);
- }
-
- public static string GenerateSignKey()
- {
- byte[] tmp = new byte[4];
- Rnd.NextBytes(tmp);
-
- char[] res = new char[8];
- for (int i = 0; i < tmp.Length; i++)
- {
- res[i * 2] = HEX_CHARS[tmp[i] & 0xF];
- res[i * 2 + 1] = HEX_CHARS[(tmp[i] >> 4) & 0xF];
- }
-
- return new string(res);
- }
- }
-}