-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
35 lines (35 loc) · 1016 Bytes
/
example.php
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
31
32
33
34
35
<?php
require_once __DIR__.'/vendor/autoload.php';
$input = file_get_contents('php://input');
$jwt = \Saiks24\JWT\JWT::create($input);
var_dump($jwt->getPayload());
var_dump($jwt->isOld());
//$header = base64_encode(json_encode([
// 'typ'=>'JWT',
// 'alg'=>'HS256'
//]));
//$payload = base64_encode(json_encode([
// 'role'=>1,
// 'id'=>1,
// 'invalidate' => time()-10
//]));
//$refreshTokens = [];
//$signature = hash_hmac('sha256',$header.'.'.$payload,'testSecret',false);
//$jwt = $header . '.' . $payload . '.' . $signature;
//var_dump($jwt);
//$jwtObject = \Saiks24\JWT\JWT::create($jwt);
//$jwtObject->setStorageStrategy(new \Saiks24\JWT\Storage\RedisStorage());
//$i = 0;
//$redis = new \Saiks24\JWT\Storage\RedisStorage([
// 'address' => '0.0.0.0'
//]);
//while (true) {
// $jwtObject = \Saiks24\JWT\JWT::create($jwt);
// $jwtObject->setStorageStrategy($redis);
// var_dump($i);
// if($i == 50000) {
// break;
// }
// $jwtObject->add($i,$jwtObject);
// $i++;
//}