◐ Shell
reader mode source ↗
add a note

User Contributed Notes 1 note

up
0
Anonymous
18 days ago
<?php

$a = "\x01\x00\x00\x00"; // 1 (32-bit little-endian)
$b = "\x02\x00\x00\x00"; // 2 (32-bit little-endian)

echo "Before: " . bin2hex($a) . PHP_EOL;

sodium_add($a, $b);

echo "After:  " . bin2hex($a) . PHP_EOL;

?>

Output:

Before: 01000000
After:  03000000
To Top