-1

I'm trying to replicate a C# piece of code in PHP and can't figure out this next line:

var digestBytes = new byte[nonceBytes.Length + createdBytes.Length + passwordBytes.Length];

Is there any new byte[length] equivalent for PHP?

Thanks in advance!

enbermudas
  • 1,603
  • 4
  • 20
  • 42
  • 1
    Does this answer your question? [How to create an empty array in PHP with predefined size?](https://stackoverflow.com/questions/5385433/how-to-create-an-empty-array-in-php-with-predefined-size) – MindSwipe Jan 17 '20 at 15:05

1 Answers1

0

PHP doesn't have a byte type, but you could use an array of ints instead

$some_data = 0;
$length = 3;
$bytes = array_fill(0, $length, $some_data);
donaldsa18
  • 302
  • 1
  • 4