thephpleague/oauth2-server — pull request #273 by sarciszewski (2014-12-08 23:41:15+00:00)
Title: Make Util/KeyAlgorithm/DefaultAlgorithm guarantee $len bytes of output even in edge cases.

Prevent edge-case whereby, if the majority of `base64_encode($bytes)` consists of `/` or `+` characters, the resulting key will be shorter and less unpredictable (due to a smaller keyspace) than anticipated.

As a result, the `$len * 2` hack has been removed. Although it is highly probable that `$len * 2` will stop most edge cases from occurring, it does not actually guarantee the end result will be at least 40 characters long.