web-base/Core/Objects/TwoFactor/CBORDecoder.trait.php

15 lines
265 B
PHP
Raw Permalink Normal View History

2022-02-20 16:53:26 +01:00
<?php
2022-11-18 18:06:46 +01:00
namespace Core\Objects\TwoFactor;
2022-02-20 16:53:26 +01:00
2024-04-07 18:29:33 +02:00
use CBOR\Decoder;
2022-02-20 16:53:26 +01:00
use CBOR\StringStream;
trait CBORDecoder {
protected function decode(string $buffer): \CBOR\CBORObject {
2024-04-07 18:29:33 +02:00
$decoder = Decoder::create();
2022-02-20 16:53:26 +01:00
return $decoder->decode(new StringStream($buffer));
}
}