[CHANGE] Added old cipher implementation
This commit is contained in:
18
Manager.YouTube/Util/Cipher/Operations/CipherReverse.cs
Normal file
18
Manager.YouTube/Util/Cipher/Operations/CipherReverse.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Text;
|
||||
|
||||
namespace Manager.YouTube.Util.Cipher.Operations;
|
||||
|
||||
public class CipherReverse : ICipherOperation
|
||||
{
|
||||
public string Decipher(string cipherSignature)
|
||||
{
|
||||
var buffer = new StringBuilder(cipherSignature.Length);
|
||||
|
||||
for (var i = cipherSignature.Length - 1; i >= 0; i--)
|
||||
{
|
||||
buffer.Append(cipherSignature[i]);
|
||||
}
|
||||
|
||||
return buffer.ToString();
|
||||
}
|
||||
}
|
||||
6
Manager.YouTube/Util/Cipher/Operations/CipherSlice.cs
Normal file
6
Manager.YouTube/Util/Cipher/Operations/CipherSlice.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Manager.YouTube.Util.Cipher.Operations;
|
||||
|
||||
public class CipherSlice(int indexToSlice) : ICipherOperation
|
||||
{
|
||||
public string Decipher(string cipherSignature) => cipherSignature[indexToSlice..];
|
||||
}
|
||||
12
Manager.YouTube/Util/Cipher/Operations/CipherSwap.cs
Normal file
12
Manager.YouTube/Util/Cipher/Operations/CipherSwap.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Text;
|
||||
|
||||
namespace Manager.YouTube.Util.Cipher.Operations;
|
||||
|
||||
public class CipherSwap(int indexToSwap) : ICipherOperation
|
||||
{
|
||||
public string Decipher(string cipherSignature) => new StringBuilder(cipherSignature)
|
||||
{
|
||||
[0] = cipherSignature[indexToSwap],
|
||||
[indexToSwap] = cipherSignature[0]
|
||||
}.ToString();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Manager.YouTube.Util.Cipher.Operations;
|
||||
|
||||
public interface ICipherOperation
|
||||
{
|
||||
string Decipher(string cipherSignature);
|
||||
}
|
||||
Reference in New Issue
Block a user