Implemented the HashService and its service registration code

This commit is contained in:
Khwezi Mngoma
2026-05-31 19:37:19 +02:00
parent f88cc42a88
commit 48f4cd45f1
16 changed files with 163 additions and 23 deletions
@@ -1,4 +1,4 @@
using static LiteCharms.Features.Extensions.Hash;
using LiteCharms.Features.Hasher;
namespace LiteCharms.Features.S3.Abstractions;
@@ -26,7 +26,7 @@ public abstract class S3ServiceBase(IAmazonS3 amazonS3)
stream.Seek(0, SeekOrigin.Begin);
var fileHash = StreamToSha256Hash(stream);
var fileHash = HashService.StreamToSha256Hash(stream);
if(string.IsNullOrWhiteSpace(fileHash))
return Result.Fail<string>("Failed to compute file hash.");
@@ -39,7 +39,7 @@ public abstract class S3ServiceBase(IAmazonS3 amazonS3)
Key = fileKey,
InputStream = stream,
ContentType = contentType,
UseChunkEncoding = false
UseChunkEncoding = false,
};
stream.Seek(0, SeekOrigin.Begin);