/
afanasevn
/
PdfEncoder
Обзор
Документация
Войти
/
afanasevn
/
PdfEncoder
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/PdfEncoder.Infrastructure/Hashing/ContentHashService.cs
18 строк
558 B
IBS\NAfanasev
DocumentContext local functional
01 июл 2026, 15:30
01 июл 2026, 15:30
b4038c9
Код
Авторство
О чём код?
using System.Security.Cryptography; using PdfEncoder.Application.Abstractions; namespace PdfEncoder.Infrastructure.Hashing; /// <summary> /// SHA256 хеширование содержимого PDF. /// </summary> public sealed class ContentHashService : IContentHashService { /// <inheritdoc /> public string ComputeHash(ReadOnlySpan<byte> content) { Span<byte> hashBytes = stackalloc byte[SHA256.HashSizeInBytes]; SHA256.HashData(content, hashBytes); return Convert.ToHexString(hashBytes).ToLowerInvariant(); } }