1: | <?php |
2: | namespace Hyperwallet\Util; |
3: | |
4: | use Hyperwallet\Exception\HyperwalletException; |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | class HyperwalletUUID { |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | public static function v4() { |
21: | return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', |
22: | |
23: | |
24: | mt_rand(0, 0xffff), mt_rand(0, 0xffff), |
25: | |
26: | |
27: | mt_rand(0, 0xffff), |
28: | |
29: | |
30: | |
31: | mt_rand(0, 0x0fff) | 0x4000, |
32: | |
33: | |
34: | |
35: | |
36: | mt_rand(0, 0x3fff) | 0x8000, |
37: | |
38: | |
39: | mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) |
40: | ); |
41: | } |
42: | } |
43: | |