Merge pull request #2616 from jmichelp/fix14b
[RRG-proxmark3.git] / armsrc / wiegand.h
blob1c92b2ea6b3fac69ffd9fd885f0a4ec6eb9b2db6
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // Generic Wiegand Calculation code
17 //-----------------------------------------------------------------------------
19 #ifndef __WIEGAND_H
20 #define __WIEGAND_H
22 #include "common.h"
24 uint8_t getParity(const uint8_t *bits, uint8_t len, uint8_t type);
25 uint8_t checkParity(uint32_t bits, uint8_t len, uint8_t type);
27 void num_to_wiegand_bytes(uint64_t oem, uint64_t fc, uint64_t cn, uint8_t *dest, uint8_t formatlen);
28 void num_to_wiegand_bits(uint64_t oem, uint64_t fc, uint64_t cn, uint8_t *dest, uint8_t formatlen);
30 #endif /* __WIEGAND_H */