Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/**
4
 * This file is part of the ramsey/uuid library
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
10
 * @license http://opensource.org/licenses/MIT MIT
11
 */
12
 
13
declare(strict_types=1);
14
 
15
namespace Ramsey\Uuid\Converter\Number;
16
 
17
use Ramsey\Uuid\Converter\NumberConverterInterface;
18
use Ramsey\Uuid\Math\BrickMathCalculator;
19
 
20
/**
21
 * Previously used to integrate moontoast/math as a bignum arithmetic library,
22
 * BigNumberConverter is deprecated in favor of GenericNumberConverter
23
 *
24
 * @deprecated Transition to {@see GenericNumberConverter}.
25
 *
26
 * @psalm-immutable
27
 */
28
class BigNumberConverter implements NumberConverterInterface
29
{
30
    private NumberConverterInterface $converter;
31
 
32
    public function __construct()
33
    {
34
        $this->converter = new GenericNumberConverter(new BrickMathCalculator());
35
    }
36
 
37
    /**
38
     * @inheritDoc
39
     * @psalm-pure
40
     */
41
    public function fromHex(string $hex): string
42
    {
43
        return $this->converter->fromHex($hex);
44
    }
45
 
46
    /**
47
     * @inheritDoc
48
     * @psalm-pure
49
     */
50
    public function toHex(string $number): string
51
    {
52
        return $this->converter->toHex($number);
53
    }
54
}