i am having some problems using pack() in php
$currencypair = \"EUR/USD\";
$buy_sell = \"buy\";
$alert_device_token =array(\"a\",\"a\",\"b\");
$message = \"
One of the reason for the error is related to the checksums,
Because PHP's integer type is signed many crc32 checksums will result in negative integers on 32bit platforms. On 64bit installations all crc32() results will be positive integers though. So you need to use the "%u" formatter of sprintf() or printf() to get the string representation of the unsigned crc32() checksum in decimal format. http://www.php.net/crc32
To fix the error this might be sufficient,
sprintf('%u', CRC32($someString))
In this case,
pack('H*', str_replace(' ', '', sprintf('%u', CRC32($alert_device))))
Ref: https://github.com/bearsunday/BEAR.Package/issues/136