Skip to content

Instantly share code, notes, and snippets.

@inxilpro
Created March 8, 2017 18:39
Show Gist options
  • Select an option

  • Save inxilpro/3491da8a8d90e33f36a51931e867df36 to your computer and use it in GitHub Desktop.

Select an option

Save inxilpro/3491da8a8d90e33f36a51931e867df36 to your computer and use it in GitHub Desktop.
<?php
$key = '[[ KEY ]]';
$userData = [
'avatarURL' => $user->avatarURL,
'email' => $user->email,
'id' => $user->id,
'name' => $user->name
]);
$token = bin2hex(openssl_encrypt(json_encode($data), 'AES-128-ECB', md5($key, true), OPENSSL_RAW_DATA));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment