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

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

(requires PHP bcmath extension)
protected hex_to_dec ( $hex ) : string
$hex (string) hexadecimal number to convert specified as a string
Результат string hexadecimal representation
    protected function hex_to_dec($hex)
    {
        $dec = 0;
        $bitval = 1;
        $len = strlen($hex);
        for ($pos = $len - 1; $pos >= 0; --$pos) {
            $dec = bcadd($dec, bcmul(hexdec($hex[$pos]), $bitval));
            $bitval = bcmul($bitval, 16);
        }
        return $dec;
    }