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

15 lines
265 B
PHP

<?php
namespace Core\Objects\TwoFactor;
use CBOR\Decoder;
use CBOR\StringStream;
trait CBORDecoder {
protected function decode(string $buffer): \CBOR\CBORObject {
$decoder = Decoder::create();
return $decoder->decode(new StringStream($buffer));
}
}