private static function _intStrToByteStr($intStr) {
        // Check if given value is a positive integer (string).
        if (!preg_match('/[0-9]+/', (string) $intStr)) {
            $msg = 'Argument 1 must be a non-negative integer or a string representing a non-negative integer.';
            throw new InvalidArgumentException($msg, self::E_NO_NON_NEGATIVE_INT);
        }
        $byteStr = '';
        // If possible, use integer type for conversion.
        $int = (int) $intStr;
        if ((string) $int == (string) $intStr) {
            // Use of integer type is possible.
            // Convert integer to byte-string.
            while ($int > 0) {
                $byteStr = chr($int & 255) . $byteStr;
                $int >>= 8;
            }
        } else {
            // Cannot use integer type, use BC Math library.
            if (extension_loaded('bcmath')) {
                // Convert integer to byte-string.
                while ((int) $intStr > 0) {
                    $byteStr = chr(bcmod($intStr, '256')) . $byteStr;
                    $intStr = bcdiv($intStr, '256', 0);
                }
            } else {
                throw new RuntimeException('BC Math functions are not available.', self::E_NO_BCMATH);
            }
        }
        if ($byteStr == '')
            $byteStr = chr(0);
        return $byteStr;
    }