Package 'ISO11784Tools'

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

Help Index


Binary to Decimal converter

Description

Binary to Decimal converter

Usage

binary_to_decimal(bin)

Arguments

bin

A single binary number as a string - nchar(bin) <= 54

Value

A single decimal number as a string

Examples

binary_to_decimal('1001100')

Binary to Hexadecimal converter

Description

Binary to Hexadecimal converter

Usage

binary_to_hexadecimal(bin)

Arguments

bin

A single binary number as a string

Value

A single hexadecimal number as a string

Examples

binary_to_hexadecimal('1001101')

Convert a list of codes to all other formats

Description

Convert a list of codes to all other formats

Usage

convert_to_all(.data)

Arguments

.data

A vector of character strings

Value

A tibble containing the original codes with a detected format column plus a column for each known format

Examples

convert_to_all(c('3DD.ABC4567890'))

Convert any recognised ISO11784/5 format to Raw Hexadecimal format, animal tag bit on the Left

Description

Convert any recognised ISO11784/5 format to Raw Hexadecimal format, animal tag bit on the Left

Usage

convert_to_iso64bitl(.data)

Arguments

.data

A vector of character strings

Value

A converted vector of character strings

Examples

convert_to_iso64bitl(c('999012345678901','3E7.02DFDC1C36','EC383BFB439F0001'))

Convert any recognised ISO11784/5 format to Raw Hexadecimal format, animal tag bit on the Right

Description

Convert any recognised ISO11784/5 format to Raw Hexadecimal format, animal tag bit on the Right

Usage

convert_to_iso64bitr(.data)

Arguments

.data

A vector of character strings

Value

A converted vector of character strings

Examples

convert_to_iso64bitr(c('999012345678901','8000F9C2DFDC1C36','3E7.02DFDC1C37'))

Convert any recognised ISO11784/5 format to Decimal format

Description

Convert any recognised ISO11784/5 format to Decimal format

Usage

convert_to_isodecimal(.data)

Arguments

.data

A vector of character strings

Value

A converted vector of character strings

Examples

convert_to_isodecimal(c('3E7.02DFDC1C35','8000F9C2DFDC1C36','EC383BFB439F0001'))

Convert any recognised ISO11784/5 format to Dot Hexadecimal format

Description

Convert any recognised ISO11784/5 format to Dot Hexadecimal format

Usage

convert_to_isodothex(.data)

Arguments

.data

A vector of character strings

Value

A converted vector of character strings

Examples

convert_to_isodothex(c('999012345678901','8000F9C2DFDC1C36','EC383BFB439F0001'))

Decimal to Binary converter

Description

Decimal to Binary converter

Usage

decimal_to_binary(dec)

Arguments

dec

A single decimal number as a string

Value

A single binary number as a string

Examples

decimal_to_binary('1234')

Decimal to Hexadecimal converter

Description

Decimal to Hexadecimal converter

Usage

decimal_to_hexadecimal(dec)

Arguments

dec

A single decimal number as a string

Value

A single hexadecimal number as a string

Examples

decimal_to_hexadecimal('1234')

ISO11784 Pattern detection routine to identify (as far as possible) the input format

Description

ISO11784 Pattern detection routine to identify (as far as possible) the input format

Usage

get_iso11784_format(.data)

Arguments

.data

A vector of character strings

Value

A vector of character strings, each item being one of 5 formats: c('unknown', 'isodecimal', 'isodothex','iso64bitl', 'iso64bitr')

Examples

get_iso11784_format(c('3DD.ABC4567890'))

Hexadecimal to Binary converter This is simply a wrapper for decimal_to_binary and hexadecimal_to_decimal

Description

Hexadecimal to Binary converter This is simply a wrapper for decimal_to_binary and hexadecimal_to_decimal

Usage

hexadecimal_to_binary(hex)

Arguments

hex

A single hexadecimal number as a string

Value

A single binary number as a string

Examples

hexadecimal_to_binary('ABC123')

Hexadecimal to Decimal converter

Description

Hexadecimal to Decimal converter

Usage

hexadecimal_to_decimal(hex)

Arguments

hex

A single hexadecimal number as a string. Max '40000000000000'

Value

A single decimal number as a string

Examples

hexadecimal_to_decimal('ABC123')

ISO 11784 Raw Hexadecimal format, animal ID on the LEFT, To ISO11784 15 Digit Decimal

Description

ISO 11784 Raw Hexadecimal format, animal ID on the LEFT, To ISO11784 15 Digit Decimal

Usage

iso64bitleft_to_isodecimal(.data)

Arguments

.data

A vector of Raw Hexadecimal format strings.

Value

A vector of ISO11784 15 Digit Decimal format strings.

Examples

iso64bitleft_to_isodecimal(c('8000ABCDEF123456'))

ISO 11784 Raw Hexadecimal format, animal ID on the RIGHT, To ISO11784 15 Digit Decimal

Description

ISO 11784 Raw Hexadecimal format, animal ID on the RIGHT, To ISO11784 15 Digit Decimal

Usage

iso64bitright_to_isodecimal(.data)

Arguments

.data

A vector of Raw Hexadecimal format strings.

Value

A vector of ISO11784 15 Digit Decimal format strings.

Examples

iso64bitright_to_isodecimal(c('ABCDEF1234560001'))

ISO11784 15 Digit Decimal format To ISO11784 Raw Hexadecimal format, animal ID on the LEFT

Description

ISO11784 15 Digit Decimal format To ISO11784 Raw Hexadecimal format, animal ID on the LEFT

Usage

isodecimal_to_iso64bitleft(.data)

Arguments

.data

A vector of ISO11784 15 Digit Decimal format strings.

Value

A vector of Raw Hexadecimal format strings.

Examples

isodecimal_to_iso64bitleft(c('989737733408912'))

ISO11784 15 Digit Decimal format To ISO11784 Raw Hexadecimal format, animal ID on the RIGHT

Description

ISO11784 15 Digit Decimal format To ISO11784 Raw Hexadecimal format, animal ID on the RIGHT

Usage

isodecimal_to_iso64bitright(.data)

Arguments

.data

A vector of ISO11784 15 Digit Decimal format strings.

Value

A vector of Raw Hexadecimal format strings.

Examples

isodecimal_to_iso64bitright(c('989737733408912'))

ISO11784 15 Digit Decimal format To ISO11784 Dot Hexadecimal

Description

ISO11784 15 Digit Decimal format To ISO11784 Dot Hexadecimal

Usage

isodecimal_to_isodothex(.data)

Arguments

.data

A vector of ISO11784 15 Digit Decimal format strings.

Value

A vector of Dot Hexadecimal format strings.

Examples

isodecimal_to_isodothex(c('989737733408912'))

ISO 11784 Dot Hexadecimal format To ISO11784 15 Digit Decimal

Description

ISO 11784 Dot Hexadecimal format To ISO11784 15 Digit Decimal

Usage

isodothex_to_isodecimal(.data)

Arguments

.data

A vector of Dot Hexadecimal format strings.

Value

A vector of ISO11784 15 Digit Decimal format strings.

Examples

isodothex_to_isodecimal(c('3DD.3BC4567890'))