initial commit
This commit is contained in:
20
CTF/Decryptify1.2/invite.js
Normal file
20
CTF/Decryptify1.2/invite.js
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
This function generates a invite_code against a user email.
|
||||
|
||||
|
||||
// Token generation example
|
||||
function calculate_seed_value($email, $constant_value) {
|
||||
$email_length = strlen($email);
|
||||
$email_hex = hexdec(substr($email, 0, 8));
|
||||
$seed_value = hexdec($email_length + $constant_value + $email_hex);
|
||||
|
||||
return $seed_value;
|
||||
}
|
||||
$seed_value = calculate_seed_value($email, $constant_value);
|
||||
mt_srand($seed_value);
|
||||
$random = mt_rand();
|
||||
$invite_code = base64_encode($random);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user