- substr: documentation ( source)
- var_dump: documentation ( source)
- hash: documentation ( source)
- hexdec: documentation ( source)
<?php
$string = 'Foo';
$hex16 = substr(
hash( 'sha256', $string ),
0,
16
);
$hexhi = substr( $hex16, 0, 8 );
$hexlo = substr( $hex16, 8, 8 );
$int = hexdec( $hexlo ) | ( hexdec( $hexhi ) << 32 );
var_dump($int);