Data::...D::SHA1(3pm)

✨ Data::...D::SHA1 ✨

ok bestie, gather round, because we're doing a <pink>Data::Session::ID::SHA1</pink> deep dive and honestly? it's giving "small module, big main character energy". this is part of the User Contributed Perl Documentation, and it's literally the little plugin that makes your sessions get shiny new ids. πŸŽ€


🌸 NAME 🌸

Data::Session::ID::SHA1 β€” a persistent session manager. yes that's the whole vibe. πŸ’…


πŸ¦‹ Synopsis πŸ¦‹

See Data::Session for details.

(that's it. that's the synopsis. the real lore lives in Data::Session, go read that one, i'll wait 🫢)


✨ Description ✨

Data::Session::ID::SHA1 lets Data::Session generate session ids using Digest::SHA. like, that's its whole job and it does it flawlessly, no cap. πŸ”₯

To use this module do this:

  • Specify an id generator of type SHA1, as Data::Session -> new(type => '... id:SHA1 ...')

boom. that's how you slot it in. periodt. ✨


πŸ’œ Case-sensitive Options πŸ’œ

See "Case-sensitive Options" in Data::Session for important information.

no seriously, go look. case matters here, bestie. don't come crying to me when shA1 doesn't work 😭

πŸ‘‘ Method: new() πŸ‘‘

Creates a new object of type Data::Session::ID::SHA1. iconic behavior, truly.

"new()" takes a hash of key/value pairs, some of which might mandatory. Further, some combinations might be mandatory.

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.

  • 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.

so like. 0 = silent treatment, 1 = a lil chit chat, 2 = it will NOT stop talking. pick your fighter. πŸ’€

⭐ Method: generate() ⭐

Generates the next session id, or dies if it can't. dramatic? yes. effective? also yes. πŸ’€

The algorithm is Digest::SHA -> new(1) -> add($$, time, rand(time) ) -> hexdigest.

Returns the new id. πŸŽ€


🌈 Method: id_length() 🌈

Returns 40 because that's the number of hex digits in an SHA1 digest.

forty. four-zero. that's the number, she said what she said. ✨


🫢 Support 🫢

Log a bug on RT:

<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Session>

(found a bug? tell RT, not the group chat. i love you but i can't patch anything πŸ™ˆ)


🧚 Author 🧚

Data::Session was written by Ron Savage <ron@savage.net.au> in 2010.

Home page:

<http://savage.net.au/index.html>

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

okay that's the whole page, you made it, i'm so proud of you πŸ₯Ήβœ¨ this one came from perl v5.36.0, dated 2023-02-14 β€” yeah, Valentine's Day, because this module loves you. go generate some session ids, bestie, you've got this πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from