Guest User

Untitled

a guest
Jan 23rd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. $billerId = '9999986379225246';
  2. $authToken = '16dfe8d7-889b-4380-925f-9c2c6ea4d930';
  3.  
  4. $auth = $billerId . ':' . $authToken;
  5.  
  6. //this results in error
  7. $auth_key_byte_array = unpack("H*",$auth);
  8.  
  9. //this also results in error
  10. $auth_key_byte_array = hash_hmac("sha256", $auth, false);
  11.  
  12. //even tried a loop function
  13. function create_byte_array($string){
  14. $array = array();
  15. foreach(str_split($string) as $char){
  16. array_push($array, sprintf("%02X", ord($char)));
  17. }
  18. return implode('', $array);
  19. }
  20.  
  21. $auth_key_byte_array = create_byte_array($auth);
Add Comment
Please, Sign In to add comment