php decimal hash wanted: like md5() but should only return numbers

Hello,

I want a PHP function to return a 10 digit hash that only contains numbers.  I cannot use MD5 because it returns the letters a through d as well as numbers.
LVL 16
hankknightAsked:
Who is Participating?
 
Alex-w474Connect With a Mentor Commented:
You can use crc32: http://php.net/manual/en/function.crc32.php
printf('%u', crc32($text));

Open in new window

0
 
RoonaanCommented:
have you tried:

$hash = rand(1000000000,9999999999);
0
 
Alex-w474Commented:
>have you tried:
>$hash = rand(1000000000,9999999999);

It is not a hash as per it is.
0
 
RoonaanCommented:
Yeah, sorry. That's just a random number.
0
 
hankknightAuthor Commented:
Alex-w474.

crc32 meets my needs perfectly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.