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, as Data::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 to STDERR more or less information. Typical values are 0, 1 and 2. This key is normally passed in as Data::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 ๐Ÿ 


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