fs2.hashing
Members list
Type members
Classlikes
Result of a hash operation.
Enumeration of hash algorithms.
Enumeration of hash algorithms.
Note: The existence of an algorithm in this list does not guarantee it is supported at runtime, as algorithm support is platform specific.
The Named
constructor allows specifying an algorithm name that's not in this list. The supplied name will be passed to the underlying crypto provider when creating a Hasher
.
Implementation note: this class is not sealed, and its constructor is private, to allow for addition of new cases in the future without breaking compatibility.
Attributes
- Companion
- object
- Source
- HashAlgorithm.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- class
- Source
- HashAlgorithm.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HashAlgorithm.type
Attributes
- Source
- HashVerificationException.scala
- Supertypes
Mutable data structure that incrementally computes a hash from chunks of bytes.
Mutable data structure that incrementally computes a hash from chunks of bytes.
To compute a hash, call update
one or more times and then call hash
. The result of hash
is the hash value of all the bytes since the last call to hash
.
A Hasher
does **not** store all bytes between calls to hash
and hence is safe for computing hashes over very large data sets using constant memory.
A Hasher
may be called from different fibers but operations on a hash should not be called concurrently.
Attributes
- Companion
- object
- Source
- Hasher.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Source
- Hasher.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Hasher.type
Capability trait that provides hashing.
Capability trait that provides hashing.
The hasher method returns a fresh Hasher
object as a resource. Hasher
is a mutable object that supports incremental computation of hashes.
A Hasher
instance should be created for each hash you want to compute, though Hasher
objects may be reused to compute consecutive hashes. When doing so, care must be taken to ensure no concurrent usage.
The hashWith
operation converts a Resource[F, Hasher[F]]
to a Pipe[F, Byte, Hash]
. The resulting pipe outputs a single Hash
once the source byte stream terminates.
Alternatively, a Resource[F, Hasher[F]]
can be used directly (via .use
or via Stream.resource
). The Hasher[F]
trait provides lower level operations for computing hashes, both at an individual chunk level (via update
and digest
) and at stream level (e.g., via observe
and drain
).
Finally, the Hashing
companion object offers utilities for computing pure hashes: hashPureStream
and hashChunk
.
Attributes
- Companion
- object
- Source
- Hashing.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Source
- Hashing.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Hashing.type