Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function generateReferenceNumber($prefix = null, $length = 8)
- {
- $az = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZMULTIPAY';
- $azr = rand(0, 51);
- $azs = substr($az, $azr, 10);
- $stamp = hash('sha256', time());
- $mt = hash('sha256', mt_rand(5, 20));
- $alpha = hash('sha256', $azs);
- $hash = str_shuffle($stamp . $mt . $alpha);
- $code = strtoupper(substr($hash, $azr, $length));
- if (!is_null($prefix) && !empty(trim($prefix))) {
- $code = $prefix . $code;
- }
- return $code;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement