class

Hashcash::Stamp

Inherits Reference < Object

Constants

DEFAULT_BITS = 20
STAMP_VERSION = "1"

Constructors

new(resource : String, version : String = STAMP_VERSION, bits : Int32 = DEFAULT_BITS, date : Time = Time.utc, ext : String = "", rand : String = Random::Secure.base64(12), counter : Int32 = 0)
Source

Class methods

default_time_window
Source
parse(stamp : String)
Source

Instance methods

bits
Source
correct_bits?(bits = bits) : Bool
Source
counter
Source
date
Source
is_for?(resource : String) : Bool
Source
rand
Source
resource
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
update_counter
Source
valid?(window : Range(Time, Time) = Stamp.default_time_window) : Bool
Source
version
Source