-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUID.php
More file actions
30 lines (25 loc) · 635 Bytes
/
UID.php
File metadata and controls
30 lines (25 loc) · 635 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter Unique ID Generation Library
*
* Generate Unique ID in CodeIgniter applications.
*
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author Ishwar Acharya
* @link https://github.com/imishwaracharya
* @link https://ishwaracharya.com.np
*/
class UID
{
public function generate()
{
return uniqid(substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz1234567890'), 0, 7));
}
public function md5()
{
return md5($this->generate());
}
}
?>