Comment 2 for bug 915260

Revision history for this message
Lex Oulu (lexoulu) wrote :

I did a test, changed the length of from char(32) to char(128).

when session.hash_bits_per_character = 5

php.ini, session.hash_function = sha1

=> session.hash_bits_per_character
eg. vlhao31rl8pp0vkv40e771jc73ckve49
==> generates 32 char

php.ini, session.hash_function = sha256

=> session.hash_bits_per_character
eg. e6p22gtfdr8ejs0hcg6usmgqu4627iq1al6nuciapv4a8f4acas1
==> generates 52 char

php.ini, session.hash_function = sha256

=> session.hash_bits_per_character
4uri9ipv69picauj9bn66vntpusjgvtih85b1e233gqlnph0ckflur0m95grjmgbv7fjksg1ld3npjtjm6fq8t6fu3cvbeufqvssbe0
==> generates 102 char

Table field length 128 seems to cover them both.

sha256 requiring 52 char was a small surprise to me, as I though 64 would be needed as shown in eg. http://www.xorbin.com/tools/sha256-hash-calculator
I suppose the session.hash_bits_per_character = 5 causes the difference.