class Wiegand::Wiegand35

Defined in:

wiegand/models.cr

Constant Summary

CARD_MASK = 4194300
FACILITY_MASK = 17175674880_i64
PAR_EVEN_MASK = 14725602156_i64
PAR_ODD_MASK = 7362801078_i64

Class Method Summary

Instance Method Summary

Instance methods inherited from class Wiegand::Base

card_number : UInt32 card_number, card_number=(card_number : UInt32) card_number=, facility : UInt32 facility, facility=(facility : UInt32) facility=, wiegand : UInt64 wiegand, wiegand=(wiegand : UInt64) wiegand=

Constructor methods inherited from class Wiegand::Base

new(wiegand : UInt64, facility : UInt32, card_number : UInt32) new

Class methods inherited from class Wiegand::Base

count_1s(int : UInt32 | UInt64) count_1s

Class Method Detail

def self.from_wiegand(wiegand) #

Convert wiegand 35 card data to components

1 + 12 + 20 + 2 1 + facility + card num + 2


[View source]

Instance Method Detail

def from_components(facility : UInt32, card_number : UInt32) #

Outputs the HEX code of what is written to the swipe card

Hex card data: 0x06F20107F Card Number: 2540 Card Facility Code: 4033


[View source]