Picqer\Barcode\BarcodeGenerator::dec_to_hex PHP Метод

dec_to_hex() защищенный Метод

(requires PHP bcmath extension)
protected dec_to_hex ( $number ) : string
$number (string) number to convert specified as a string
Результат string hexadecimal representation
    protected function dec_to_hex($number)
    {
        if ($number == 0) {
            return '00';
        }
        $hex = [];
        while ($number > 0) {
            array_push($hex, strtoupper(dechex(bcmod($number, '16'))));
            $number = bcdiv($number, '16', 0);
        }
        $hex = array_reverse($hex);
        return implode($hex);
    }