1 package Biblio::RFID::SmartX;
6 use Data::Dump qw(dump);
10 Biblio::RFID::SmartX - Croatian student cards format
17 my $hash = Biblio::RFID::Decode::SmartX->to_hash( [ 'sector1', 'sector2', ... , 'sector7' ] );
24 return join('', map { sprintf("%02x",ord($_)) } split (//, $data));
28 my ( $self, $data ) = @_;
32 die "expecting array of sectors" unless ref $data eq 'ARRAY';
37 $decoded->[$_] = bcd( $data->[$_] );
43 $hash->{SXID} = substr( $decoded->[4], 0, 20 );
44 $hash->{JMBAG} = substr( $decoded->[4], 22, 10 );
45 $hash->{OIB} = substr( $decoded->[5], 16, 11 );
46 $hash->{SPOL} = substr( $data->[5], 14, 1 ); # char, not BCD!
47 $hash->{INST_ID} = substr( $decoded->[6], 0, 12 );
48 $hash->{CARD_V} = substr( $decoded->[6], 12, 4 );
50 warn "## hash = ",dump($hash);