class Hashcash::Stamp

Defined in:

hashcash/stamp.cr

Constant Summary

DEFAULT_BITS = 20
STAMP_VERSION = "1"

Constructors

Class Method Summary

Instance Method Summary

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) #

[View source]

Class Method Detail

def self.default_time_window #

[View source]
def self.parse(stamp : String) #

[View source]

Instance Method Detail

def bits : Int32 #

[View source]
def correct_bits?(bits = bits) : Bool #

[View source]
def counter : Int32 #

[View source]
def date : Time #

[View source]
def ext : String #

[View source]
def is_for?(resource : String) : Bool #

[View source]
def rand : String #

[View source]
def resource : String #

[View source]
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>

[View source]
def update_counter #

[View source]
def valid?(window : Range(Time, Time) = Stamp.default_time_window) : Bool #

[View source]
def version : String #

[View source]