Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Support Span<byte> as Hash-function input #55

@aKzenT

Description

@aKzenT

It would be very useful for the hash functions to accept a ReadOnlySpan instead of only Stream and byte[]. More and more .NET apis are enabled for use with the various Span-datatypes and so it also happens quite often, that instead of a byte[] you are dealing with a Span, which cannot directly be used with this library.

Another advantage is the possibility to cast between various types of Span-types with the help of MemoryMarshal. This makes it possible to cast a string to a ReadOnlySpan without having to encode or copy the string first. As I often want to compute hashes from strings, this would drastically improve the performance and reduce needed allocations.

I would also be happy if this would only be supported in the block-transformer interfaces in the beginning, where you already support ArraySegment.

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