I've created this package to handle UUIDs from MFRC511 module. It uses five byte ids which can not be represented by a 32bit system. (as Raspberry Pi is 32bit.)
$ cd ~
$ git clone https://github.com/tasoftch/php-secure-int64-extension.git
$ cd php-secure-int64-extension
$ phpize
$ ./configure --enable-secure-int64
$ make
$ sudo make install
This compiles the source on your machine.
Next find the php.ini file
$ php --ini
Will list scanned ini files.
Add the following line to that php.ini file:
extension=secure_int64
<?php
var_dump( extension_loaded('secure_int64') ); // Should be true
The extension adds the following functions to the global scope:
sint64_array_to_string
Converts an array of maximal 8 bytes into a 64bit signed integer representation as string.uint64_array_to_string
Converts an array of maximal 8 bytes into a 64bit unsigned integer representation as string.sint64_string_to_array
Interprets a string as signed 64bit integer value and returns it as array, MSB first.uint64_string_to_array
Interprets a string as unsigned 64bit integer value and returns it as array, MSB first.
<?php
echo sint64_array_to_string([1]); // 1
echo sint64_array_to_string([1, 4]); // 260
echo sint64_array_to_string([0xFF, 0xFF]); // 65535
echo sint64_array_to_string([0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]); // 9223372036854775807
echo sint64_array_to_string([0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]); // -1
echo uint64_array_to_string([0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]); // 18446744073709551615
?>