Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The documentation says "The base64 encoded result will have a length of up to 4 * $byte_count."
This is wrong. I think it is always exactly ceil($byte_count * 4 / 3).
Note that drupal_base64_encode() removes the padding equal signs.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal_random_key-2745013-3.patch | 568 bytes | tetranz |
#2 | drupal_random_key-2745013-2.patch | 568 bytes | tetranz |
Issue fork drupal-2745013
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tetranz CreditAttribution: tetranz as a volunteer commentedComment #3
tetranz CreditAttribution: tetranz as a volunteer commentedRedoing this since it's so old and the line numbers in the patch are way off.
Comment #4
tetranz CreditAttribution: tetranz as a volunteer commentedComment #5
tetranz CreditAttribution: tetranz at Third and Grove commentedComment #6
joshf CreditAttribution: joshf at Third and Grove commentedConfirmed; this can be easily checked:
Comment #7
stefan.r CreditAttribution: stefan.r commentedDoes this go for Crypt::randomBytesBase64 in Drupal 8.x as well? I think they use random_bytes(), random_compat, or the same hash-based generator.
Comment #8
tetranz CreditAttribution: tetranz at Third and Grove commentedYou're quite right stefan.r, it does apply to Crypt::randomBytesBase64. I've created a related issue for that.
https://www.drupal.org/node/2866495
Setting this one back to 7.x.dev and postponed until the D8 one is committed.
Comment #9
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedThe parent issue was commited (#3118581: The documentation for Crypt::randomBytesBase64() is wrong about the output length). From what I see, this documentation fix will needs to be tweaked a little bit to match commited D8 version.
Comment #11
apadernoComment #13
apaderno