mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-26 19:29:07 +00:00
Fix base64 image parser returning wrong hashes
This commit is contained in:
parent
4107ecc654
commit
07769e0349
1 changed files with 2 additions and 2 deletions
|
@ -277,8 +277,8 @@ public static class FileHelper
|
||||||
private static byte[]? TryParseBase64Data(string b64)
|
private static byte[]? TryParseBase64Data(string b64)
|
||||||
{
|
{
|
||||||
Span<byte> buffer = new(new byte[b64.Length]);
|
Span<byte> buffer = new(new byte[b64.Length]);
|
||||||
bool valid = Convert.TryFromBase64String(b64, buffer, out _);
|
bool valid = Convert.TryFromBase64String(b64, buffer, out int bytesWritten);
|
||||||
return valid ? buffer.ToArray() : null;
|
return valid ? buffer[..bytesWritten].ToArray() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<string?> ParseBase64Image(string? image)
|
public static async Task<string?> ParseBase64Image(string? image)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue