Skip to content

Investigate .NET 11 stream adapters for hashing filters #975

Description

@sebastienros

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions