module Digest::Instance
This module provides instance methods for a digest implementation object to calculate message digest values.
Public Instance Methods
(string) → self
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 114
def <<: (string) -> self
Updates the digest using a given string and returns self.
The update() method and the left-shift operator are overridden by each implementation subclass. (One should be an alias for the other)
(instance | string) → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 125
def ==: (instance | string) -> bool
If a string is given, checks whether it is equal to the hex-encoded hash value of the digest object. If another digest instance is given, checks whether they have the same hash value. Otherwise returns false.
(?string? str) → String
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 141
def base64digest: (?string? str) -> String
If none is given, returns the resulting hash value of the digest in a base64 encoded form, keeping the digest’s state.
If a string is given, returns the hash value for the given string in a base64 encoded form, resetting the digest to the initial state before and after the process.
In either case, the return value is properly padded with ‘=’ and contains no line feeds.
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 149
def base64digest!: () -> String
Returns the resulting hash value and resets the digest to the initial state.
() → Integer
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 159
def block_length: () -> Integer
Returns the block length of the digest.
This method is overridden by each implementation subclass.
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 167
def bubblebabble: () -> String
Returns the resulting hash value in a Bubblebabble encoded form.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 180
def digest: (?string) -> String
If none is given, returns the resulting hash value of the digest, keeping the digest’s state.
If a string is given, returns the hash value for the given string, resetting the digest to the initial state before and after the process.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 188
def digest!: () -> String
Returns the resulting hash value and resets the digest to the initial state.
() → Integer
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 199
def digest_length: () -> Integer
Returns the length of the hash value of the digest.
This method should be overridden by each implementation subclass. If not, digest_obj.digest().length() is returned.
(string name) → instance
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 207
def file: (string name) -> instance
Updates the digest with the contents of a given file name and returns self.
() → self
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 306
def finish: () -> self
Finishes the digest and returns the resulting hash value.
This method is overridden by each implementation subclass and often made private, because some of those subclasses may leave internal data uninitialized. Do not call this method from outside. Use digest!() instead, which ensures that internal data be reset for security reasons.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 221
def hexdigest: (?string) -> String
If none is given, returns the resulting hash value of the digest in a hex-encoded form, keeping the digest’s state.
If a string is given, returns the hash value for the given string in a hex-encoded form, resetting the digest to the initial state before and after the process.
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 230
def hexdigest!: () -> String
Returns the resulting hash value in a hex-encoded form and resets the digest to the initial state.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 238
def inspect: () -> String
Creates a printable version of the digest object.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 247
def length: () -> Integer
Returns digest_obj.digest_length().
() → instance
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 256
def new: () -> instance
Returns a new, initialized copy of the digest object. Equivalent to digest_obj.clone().reset().
() → self
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 266
def reset: () -> self
Resets the digest to the initial state and returns self.
This method is overridden by each implementation subclass.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 271
def size: () -> Integer
Returns digest_obj.digest_length().
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 279
def to_s: () -> String
Returns digest_obj.hexdigest().
(string) → self
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/digest/0/digest.rbs, line 291
def update: (string) -> self
Updates the digest using a given string and returns self.
The update() method and the left-shift operator are overridden by each implementation subclass. (One should be an alias for the other)