Skip to content

Conversation

nobu
Copy link
Member

@nobu nobu commented Apr 24, 2025

The option specifies the digest algorithm to hash the session id when generating the filename for this session's FileStore file. It is defaulted to "MD5" because of backward compatibility for now.

The option specifies the digest algorithm to hash the session id when
generating the filename for this session's FileStore file.  It is
defaulted to "MD5" because of backward compatibility for now.
md5 = Digest::MD5.hexdigest(session_id)[0,16]
algorithm = option['digest'] || 'MD5'
require 'digest'
digest = Digest(algorithm).hexdigest(session_id)[0,16]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we limit the size to 16 characters? This could be a security issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be another option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants