stephane-rbn / soundbase

Free online audio distribution platform that enables its users to upload, promote & share their originally-created sounds
MIT License
5 stars 0 forks source link

Add $length parameter to createToken() #17

Closed angristan closed 6 years ago

angristan commented 6 years ago

I want to create a token elsewhere with another length than 65.

bin2hex(random_bytes($int)) returns a string of length $int * 2 + 1, e.g.:

return bin2hex(random_bytes(32));
// returns a string of length (32 * 2) + 1 = 65

With this PR:

return bin2hex(random_bytes(32));
// returns a string of length (((32 * 2) / 2) + 1) -1  = 32