mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-16 06:32:28 +00:00
Multiple changes to HashHelper and RandomHelper
- Renamed HashHelper to CryptoHelper - Moved CryptoHelper.GenerateRandomBytes to RandomHelper - Documented RandomHelper
This commit is contained in:
parent
396477c05d
commit
f31a73ccaa
22 changed files with 86 additions and 86 deletions
|
@ -34,7 +34,7 @@ public class LighthouseServerTest
|
|||
{
|
||||
await using Database database = new();
|
||||
if (await database.Users.FirstOrDefaultAsync(u => u.Username == $"{username}{number}") == null)
|
||||
await database.CreateUser($"{username}{number}", HashHelper.BCryptHash($"unitTestPassword{number}"));
|
||||
await database.CreateUser($"{username}{number}", CryptoHelper.BCryptHash($"unitTestPassword{number}"));
|
||||
}
|
||||
|
||||
//TODO: generate actual tickets
|
||||
|
@ -68,7 +68,7 @@ public class LighthouseServerTest
|
|||
public async Task<HttpResponseMessage> UploadFileEndpointRequest(string filePath)
|
||||
{
|
||||
byte[] bytes = await File.ReadAllBytesAsync(filePath);
|
||||
string hash = HashHelper.Sha1Hash(bytes).ToLower();
|
||||
string hash = CryptoHelper.Sha1Hash(bytes).ToLower();
|
||||
|
||||
return await this.Client.PostAsync($"/LITTLEBIGPLANETPS3_XML/upload/{hash}", new ByteArrayContent(bytes));
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class LighthouseServerTest
|
|||
public async Task<HttpResponseMessage> AuthenticatedUploadFileEndpointRequest(string filePath, string mmAuth)
|
||||
{
|
||||
byte[] bytes = await File.ReadAllBytesAsync(filePath);
|
||||
string hash = HashHelper.Sha1Hash(bytes).ToLower();
|
||||
string hash = CryptoHelper.Sha1Hash(bytes).ToLower();
|
||||
using HttpRequestMessage requestMessage = new(HttpMethod.Post, $"/LITTLEBIGPLANETPS3_XML/upload/{hash}");
|
||||
requestMessage.Headers.Add("Cookie", mmAuth);
|
||||
requestMessage.Content = new ByteArrayContent(bytes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue