You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
486 B

<?php
$created_by = "M0174";
$date = date("Y-m-d H:i");
$ipAddress = $_SERVER['REMOTE_ADDR'];
$characters = '01234567890123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
$length = 30;
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
$token = $created_by . $date . $ipAddress;
$new_token = md5(hash('sha256', hash('sha256', md5($token)) . $randomString));