Skip to content

Add 'digest' option #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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.

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