abstract class MbedTLS::Digest
- MbedTLS::Digest
- Reference
- Object
Overview
Abstract base class for using the mbed TLS crypto library to produce digests for given data.
NOTE The Digest class cannot be directly instantiated. Use one of it's subclasses instead.
Included Modules
- MbedTLS::Digest::DigestClassBuilder
- MbedTLS::Digest::DigestClassBuilder::DigestClassBuilderIntl(LibMbedCrypto::MDType)
- MbedTLS::DigestBase
Direct Known Subclasses
- MbedTLS::Digest::MD2
- MbedTLS::Digest::MD4
- MbedTLS::Digest::MD5
- MbedTLS::Digest::RIPEMD160
- MbedTLS::Digest::SHA1
- MbedTLS::Digest::SHA224
- MbedTLS::Digest::SHA256
- MbedTLS::Digest::SHA384
- MbedTLS::Digest::SHA512
Defined in:
digest/digest.crClass Method Summary
-
.supported_types
Returns a tuple of types supported by the linked libmbedcrypto.
Instance Method Summary
-
#base64digest!
Hash the buffer and return the Base64 encoded representation of the digest without allocating a new instance.
-
#clone : Digest
Create an instance of the Digest object with it's internal state copied from this instance.
-
#digest!
Hash the buffer and return the raw bytes returned by the digest algorithm without allocating a new instance.
-
#digest_size : UInt8
The length of the digest message this algorithm produces, in bytes.
-
#finalize
Handles the cleanup of the mbed TLS library handles associated with this
Digest
instance. -
#hexdigest!
Hash the buffer and return the hexadecimal representation of the digest without allocating a new instance.
-
#md_type_of : Type
The
Type
enum of this Digest algorithm. -
#name : String
The readable name of this Digest algorithm.
-
#reset
Clear the buffer and reset the internal state of the digest context.
-
#to_unsafe : Pointer(LibMbedCrypto::MDContext)
Returns a pointer to the internal context used by the library.
-
#update(data : String | Slice)
Add data to the buffer for hashing.
Instance methods inherited from module MbedTLS::DigestBase
<<(data)
<<,
base64digest
base64digest,
digest
digest,
file(file_name)
file,
hexdigest
hexdigest,
to_s(io)
to_s,
update(io : IO)
update
Class methods inherited from module MbedTLS::DigestBase
hexdump(digest)
hexdump
Class Method Detail
Instance Method Detail
Hash the buffer and return the Base64 encoded representation of the digest without allocating a new instance.
NOTE The Digest
instance is reset after use.
Create an instance of the Digest object with it's internal state copied from this instance.
Hash the buffer and return the raw bytes returned by the digest algorithm without allocating a new instance.
NOTE The Digest
instance is reset after use.
The length of the digest message this algorithm produces, in bytes.
Handles the cleanup of the mbed TLS library handles associated with this Digest
instance.
Hash the buffer and return the hexadecimal representation of the digest without allocating a new instance.
NOTE The Digest
instance is reset after use.
Returns a pointer to the internal context used by the library.
Add data to the buffer for hashing.
NOTE This method is an implementation detail. Use the more user friendly DigestBase.<<
to hash data, or the DigestBase.file
method to hash files.