Data::...:SHA256(3pm)
โจ NAME โจ
Data::Session::ID::SHA256 โ a persistent session manager ๐ซถ (and yeah bestie, the header on this page says Data::...:SHA256(3pm) and it lives in the User Contributed Perl Documentation, so now u know where u are ๐
)
๐ธ Synopsis ๐ธ
See Data::Session for details. That's it, that's the synopsis, she's shy ๐
๐ฆ Description ๐ฆ
Data::Session::ID::SHA256 lets Data::Session generate session ids using Digest::SHA. Lowkey iconic of it.
To use this module, do this:
- Specify an id generator of type
SHA256, asData::Session -> new(type => '... id:SHA256 ...')
๐ Case-sensitive Options ๐
See "Case-sensitive Options" in Data::Session for important information. Not optional reading, bestie โ go look ๐
๐ Method: new() ๐
Creates a new object of type Data::Session::ID::SHA256. Brand new baby object, so cute ๐ผ
new() takes a hash of key/value pairs, some of which might be mandatory. Further, some combinations might be mandatory. (Yeah, it's giving "it depends" ๐ญ)
The keys are listed here in alphabetical order. They are lower-case because they are (also) method names, meaning they can be called to set or get the value at any time. Slay, dual-purpose keys โจ
verbose=>$integerโ Print toSTDERRmore or less information. Typical values are0,1and2. This key is normally passed in asData::Session -> new(verbose => $integer). This key is optional. ๐ฌ
๐ฅ Method: generate() ๐ฅ
Generates the next session id, or dies if it can't. Not me being dramatic, it literally dies ๐
The algorithm is Digest::SHA -> new(256) -> add($$, time, rand(time) ) -> hexdigest. Copy that exactly, no cap.
Returns the new id. Fresh id, just dropped ๐
โญ Method: id_length() โญ
Returns 64 because that's the number of hex digits in an SHA256 digest. Sixty-four. Sixty. Four. ๐งฎ
This can be used to generate the SQL to create the sessions table. Very "let me build u a table" of it ๐ฝ๏ธ
๐ Support ๐
Log a bug on RT: <https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Session>. Do it nicely, the maintainers are people too ๐ซถ
๐ Author ๐
Data::Session was written by Ron Savage <ron@savage.net.au> in 2010. Legend behaviour, honestly ๐
Home page: <http://savage.net.au/index.html>. Go say hi ๐
๐ Copyright ๐
Australian copyright (c) 2010, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software';
you can redistribute them and/or modify them under the terms of
The Artistic License, a copy of which is available at:
http://www.opensource.org/licenses/index.html
And that's the whole page, bestie โ no notes, we ate ๐
โจ This lil beauty is from perl v5.36.0, dated 2023-02-14, and it's part of the User Contributed Perl Documentation. Happy hashing, ily, mwah ๐๐ฆ๐
๐ฆ where this page comes from
- debian trixie: libdata-session-perl 1.18-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-session-perl 1.18-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-session-perl 1.18-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-session-perl 1.18-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms