static public function bufferize($data, $byteSize = null, $paddingDirection = self::PAD_LEFT)
    {
        if (is_integer($data)) {
            // Buffer from Decimal
            return Buffer::fromInt($data, $byteSize, null, $paddingDirection);
        }

        $charLen = strlen($data);
        if (ctype_xdigit($data) && $charLen % 32 === 0) {
            // Buffer from Hexadecimal
            return Buffer::fromHex($data, $byteSize, $paddingDirection);
        }

        // Buffer from Normalized String
        return Buffer::fromString($data, $paddingDirection);
    }
static public function bufferize($data, $byteSize = null, $paddingDirection = self::PAD_LEFT)
    {
        if (is_integer($data)) {
            // Buffer from Decimal
            return Buffer::fromInt($data, $byteSize, null, $paddingDirection);
        }

        $charLen = strlen($data);
        if (ctype_xdigit($data) && $charLen % 32 === 0) {
            // Buffer from Hexadecimal
            return Buffer::fromHex($data, $byteSize, $paddingDirection);
        }

        // Buffer from Normalized String
        return Buffer::fromString($data, $paddingDirection);
    }
static public function bufferize ( $ data , $ byteSize = null , $ paddingDirection = self :: PAD_LEFT ) { if ( is_integer ( $ data ) ) { // Buffer from Decimal return Buffer :: fromInt ( $ data , $ byteSize , null , $ paddingDirection ) ; } $ charLen = strlen ( $ data ) ; if ( ctype_xdigit ( $ data ) && $ charLen % 32 === 0 ) { // Buffer from Hexadecimal return Buffer :: fromHex ( $ data , $ byteSize , $ paddingDirection ) ; } // Buffer from Normalized String return Buffer :: fromString ( $ data , $ paddingDirection ) ; }
Build a Buffer from `data`.

Dynamic Buffer creation. Decimals, Hexadecimals
and String are handled differently in binary form.

Only use the bufferize method for Hexadecimal input
in case you are sure about the data length. It must
be a multiple of 32-bytes. (32, 64, 96, etc.)

When you are working with Hexadecimal data, it is
*preferred* to use the `fromHex` method directly.

@param   string|integer  $data
@param   integer         $byteSize
@return  \NEM\Core\Buffer
Build a Buffer from data .