Fluid's md5, sha1, sha256, hmac_sha1, and hmac_sha256 filters currently encode input strings into allocated UTF-8 byte arrays before hashing.
.NET 11 introduces StringStream, which can encode a string incrementally for APIs accepting Stream. Investigate adding a net11.0 target and conditional implementations that hash a StringStream directly.
Acceptance criteria:
- Benchmark short, medium, and large ASCII and non-ASCII values against the existing one-shot
Encoding.UTF8.GetBytes path.
- Compare
StringStream with stackalloc/ArrayPool<byte> alternatives; retain the existing path where it is faster.
- Include MD5, SHA-1, SHA-256, HMAC-SHA1, and HMAC-SHA256.
- Consider span-based hash destinations to avoid allocating the hash-result array.
- Preserve all existing target-framework behavior.
Fluid's
md5,sha1,sha256,hmac_sha1, andhmac_sha256filters currently encode input strings into allocated UTF-8 byte arrays before hashing..NET 11 introduces
StringStream, which can encode a string incrementally for APIs acceptingStream. Investigate adding anet11.0target and conditional implementations that hash aStringStreamdirectly.Acceptance criteria:
Encoding.UTF8.GetBytespath.StringStreamwith stackalloc/ArrayPool<byte>alternatives; retain the existing path where it is faster.