class Hashcash::Stamp
- Hashcash::Stamp
- Reference
- Object
Defined in:
hashcash/stamp.crConstant Summary
-
DEFAULT_BITS =
20
-
STAMP_VERSION =
"1"
Constructors
Class Method Summary
Instance Method Summary
- #bits : Int32
- #correct_bits?(bits = bits) : Bool
- #counter : Int32
- #date : Time
- #ext : String
- #is_for?(resource : String) : Bool
- #rand : String
- #resource : String
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #update_counter
- #valid?(window : Range(Time, Time) = Stamp.default_time_window) : Bool
- #version : String
Constructor Detail
def self.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)
#
Class Method Detail
Instance Method Detail
def to_s(io : IO) : Nil
#
Description copied from class Reference
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>