Module: siteKiosk.convert.binaryConverter

This module provides means to convert between bytes and basic data types (like Integer).

Example

// simple int <-> byte[] conversion
var i = 42;
var b = siteKiosk.convert.binaryConverter.convertIntegerToBytes(i);
i = siteKiosk.convert.binaryConverter.convertToInteger(b);
//i is sill 42

Methods

<static> convertIntegerToBytes(number) → {Array.<byte>}

Converts an integer value to a byte array.
Parameters:
Name Type Description
number number Integer value to be converted
Returns:
The converted bytes
Type
Array.<byte>

<static> convertToInteger(bytes) → {number}

Converts a byte array to an integer value.
Parameters:
Name Type Description
bytes Array.<byte> byte array to be converted
Returns:
The converted integer
Type
number