Title: | ISO11784 PIT Tag ID Format Converters |
---|---|
Description: | Some tools to assist with converting International Organization for Standardization (ISO) standard 11784 (ISO11784) animal ID codes between 4 recognised formats commonly displayed on Passive Integrated Transponder (PIT) tag readers. The most common formats are 15 digit decimal, e.g., 999123456789012, and 13 character hexadecimal 'dot' format, e.g., 3E7.1CBE991A14. These are referred to in this package as isodecimal and isodothex. The other two formats are the raw hexadecimal representation of the ISO11784 binary structure (see <https://en.wikipedia.org/wiki/ISO_11784_and_ISO_11785>). There are two 'flavours' of this format, a left and a right variation. Which flavour a reader happens to output depends on if the developers decided to reverse the binary number or not before converting to hexadecimal, a decision based on the fact that the PIT tags will transmit their binary code Least Significant Bit (LSB) first, or backwards basically. |
Authors: | Graeme Diack [aut, cre] |
Maintainer: | Graeme Diack <[email protected]> |
License: | GPL-3 |
Version: | 1.1.4 |
Built: | 2025-01-19 03:44:54 UTC |
Source: | https://github.com/graemediack/iso11784tools |
Binary to Decimal converter
binary_to_decimal(bin)
binary_to_decimal(bin)
bin |
A single binary number as a string - nchar(bin) <= 54 |
A single decimal number as a string
binary_to_decimal('1001100')
binary_to_decimal('1001100')
Binary to Hexadecimal converter
binary_to_hexadecimal(bin)
binary_to_hexadecimal(bin)
bin |
A single binary number as a string |
A single hexadecimal number as a string
binary_to_hexadecimal('1001101')
binary_to_hexadecimal('1001101')
Convert a list of codes to all other formats
convert_to_all(.data)
convert_to_all(.data)
.data |
A vector of character strings |
A tibble containing the original codes with a detected format column plus a column for each known format
convert_to_all(c('3DD.ABC4567890'))
convert_to_all(c('3DD.ABC4567890'))
Convert any recognised ISO11784/5 format to Raw Hexadecimal format, animal tag bit on the Left
convert_to_iso64bitl(.data)
convert_to_iso64bitl(.data)
.data |
A vector of character strings |
A converted vector of character strings
convert_to_iso64bitl(c('999012345678901','3E7.02DFDC1C36','EC383BFB439F0001'))
convert_to_iso64bitl(c('999012345678901','3E7.02DFDC1C36','EC383BFB439F0001'))
Convert any recognised ISO11784/5 format to Raw Hexadecimal format, animal tag bit on the Right
convert_to_iso64bitr(.data)
convert_to_iso64bitr(.data)
.data |
A vector of character strings |
A converted vector of character strings
convert_to_iso64bitr(c('999012345678901','8000F9C2DFDC1C36','3E7.02DFDC1C37'))
convert_to_iso64bitr(c('999012345678901','8000F9C2DFDC1C36','3E7.02DFDC1C37'))
Convert any recognised ISO11784/5 format to Decimal format
convert_to_isodecimal(.data)
convert_to_isodecimal(.data)
.data |
A vector of character strings |
A converted vector of character strings
convert_to_isodecimal(c('3E7.02DFDC1C35','8000F9C2DFDC1C36','EC383BFB439F0001'))
convert_to_isodecimal(c('3E7.02DFDC1C35','8000F9C2DFDC1C36','EC383BFB439F0001'))
Convert any recognised ISO11784/5 format to Dot Hexadecimal format
convert_to_isodothex(.data)
convert_to_isodothex(.data)
.data |
A vector of character strings |
A converted vector of character strings
convert_to_isodothex(c('999012345678901','8000F9C2DFDC1C36','EC383BFB439F0001'))
convert_to_isodothex(c('999012345678901','8000F9C2DFDC1C36','EC383BFB439F0001'))
Decimal to Binary converter
decimal_to_binary(dec)
decimal_to_binary(dec)
dec |
A single decimal number as a string |
A single binary number as a string
decimal_to_binary('1234')
decimal_to_binary('1234')
Decimal to Hexadecimal converter
decimal_to_hexadecimal(dec)
decimal_to_hexadecimal(dec)
dec |
A single decimal number as a string |
A single hexadecimal number as a string
decimal_to_hexadecimal('1234')
decimal_to_hexadecimal('1234')
ISO11784 Pattern detection routine to identify (as far as possible) the input format
get_iso11784_format(.data)
get_iso11784_format(.data)
.data |
A vector of character strings |
A vector of character strings, each item being one of 5 formats: c('unknown', 'isodecimal', 'isodothex','iso64bitl', 'iso64bitr')
get_iso11784_format(c('3DD.ABC4567890'))
get_iso11784_format(c('3DD.ABC4567890'))
Hexadecimal to Binary converter This is simply a wrapper for decimal_to_binary and hexadecimal_to_decimal
hexadecimal_to_binary(hex)
hexadecimal_to_binary(hex)
hex |
A single hexadecimal number as a string |
A single binary number as a string
hexadecimal_to_binary('ABC123')
hexadecimal_to_binary('ABC123')
Hexadecimal to Decimal converter
hexadecimal_to_decimal(hex)
hexadecimal_to_decimal(hex)
hex |
A single hexadecimal number as a string. Max '40000000000000' |
A single decimal number as a string
hexadecimal_to_decimal('ABC123')
hexadecimal_to_decimal('ABC123')
ISO 11784 Raw Hexadecimal format, animal ID on the LEFT, To ISO11784 15 Digit Decimal
iso64bitleft_to_isodecimal(.data)
iso64bitleft_to_isodecimal(.data)
.data |
A vector of Raw Hexadecimal format strings. |
A vector of ISO11784 15 Digit Decimal format strings.
iso64bitleft_to_isodecimal(c('8000ABCDEF123456'))
iso64bitleft_to_isodecimal(c('8000ABCDEF123456'))
ISO 11784 Raw Hexadecimal format, animal ID on the RIGHT, To ISO11784 15 Digit Decimal
iso64bitright_to_isodecimal(.data)
iso64bitright_to_isodecimal(.data)
.data |
A vector of Raw Hexadecimal format strings. |
A vector of ISO11784 15 Digit Decimal format strings.
iso64bitright_to_isodecimal(c('ABCDEF1234560001'))
iso64bitright_to_isodecimal(c('ABCDEF1234560001'))
ISO11784 15 Digit Decimal format To ISO11784 Raw Hexadecimal format, animal ID on the LEFT
isodecimal_to_iso64bitleft(.data)
isodecimal_to_iso64bitleft(.data)
.data |
A vector of ISO11784 15 Digit Decimal format strings. |
A vector of Raw Hexadecimal format strings.
isodecimal_to_iso64bitleft(c('989737733408912'))
isodecimal_to_iso64bitleft(c('989737733408912'))
ISO11784 15 Digit Decimal format To ISO11784 Raw Hexadecimal format, animal ID on the RIGHT
isodecimal_to_iso64bitright(.data)
isodecimal_to_iso64bitright(.data)
.data |
A vector of ISO11784 15 Digit Decimal format strings. |
A vector of Raw Hexadecimal format strings.
isodecimal_to_iso64bitright(c('989737733408912'))
isodecimal_to_iso64bitright(c('989737733408912'))
ISO11784 15 Digit Decimal format To ISO11784 Dot Hexadecimal
isodecimal_to_isodothex(.data)
isodecimal_to_isodothex(.data)
.data |
A vector of ISO11784 15 Digit Decimal format strings. |
A vector of Dot Hexadecimal format strings.
isodecimal_to_isodothex(c('989737733408912'))
isodecimal_to_isodothex(c('989737733408912'))
ISO 11784 Dot Hexadecimal format To ISO11784 15 Digit Decimal
isodothex_to_isodecimal(.data)
isodothex_to_isodecimal(.data)
.data |
A vector of Dot Hexadecimal format strings. |
A vector of ISO11784 15 Digit Decimal format strings.
isodothex_to_isodecimal(c('3DD.3BC4567890'))
isodothex_to_isodecimal(c('3DD.3BC4567890'))