PHP Classes

File: src/Ristretto.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   Ristretto PHP   src/Ristretto.php   Download  
File: src/Ristretto.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Ristretto PHP
Manipulate values in type safe way using classes
Author: By
Last change:
Date: 1 year ago
Size: 546 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);
namespace
ParagonIE\Ristretto;

use
ParagonIE\ConstantTime\Hex;
use
ParagonIE\HiddenString\HiddenString;

abstract class
Ristretto
{
    public function
__construct(protected HiddenString $bytes)
    {}

    public function
equals(Ristretto $other): bool
   
{
        return
$this->bytes->equals($other->getBytes());
    }

    public function
hex(): string
   
{
        return
Hex::encode($this->bytes->getString());
    }

    public function
getBytes(): HiddenString
   
{
        return
$this->bytes;
    }
}