Data::...:SHA512(3pm)

✨ Data::Session::ID::SHA512 ✨

okay bestie so this is a page from the User Contributed Perl Documentation section (that's the 3pm manual, iykyk) and it's literally all about Data::Session::ID::SHA512 πŸŽ€


πŸ’– NAME πŸ’–

Data::Session::ID::SHA512 β€” a persistent session manager πŸ’…


🌸 Synopsis 🌸

See Data::Session for details. that's it, that's the synopsis, she's lowkey mysterious πŸ¦‹


πŸ¦‹ Description πŸ¦‹

Data::Session::ID::SHA512 lets Data::Session generate session ids using Digest::SHA. no cap, that's the whole job and she does it gorgeously ✨

To use this module do this:

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

periodt πŸ’…


πŸŽ€ Case-sensitive Options πŸŽ€

See "Case-sensitive Options" in Data::Session for important information. fr fr, go read it, it matters πŸ™ˆ


⭐ Method: new() ⭐

Creates a new object of type Data::Session::ID::SHA512. iconic behaviour, honestly πŸ‘‘

new() takes a hash of key/value pairs, some of which might mandatory. Further, some combinations might be mandatory. (yes bestie, "might mandatory", that's exactly what it says, we don't gatekeep the original wording here πŸ’–)

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. cute AND functional, we love a dual-purpose queen 🌈

  • 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. dramatic but fair πŸ’€

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

Returns the new id. slay ✨


πŸ’œ Method: id_length() πŸ’œ

Returns 128 because that's the number of hex digits in an SHA512 digest. math ate, no crumbs 🧚

This can be used to generate the SQL to create the sessions table. very helpful of her ngl πŸ“


🌈 Support 🌈

Log a bug on RT: <https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Session>.


πŸ‘‘ 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

and that's the whole page bestie πŸŽ€ this was perl v5.36.0, dated 2023-02-14, straight from Data::...:SHA512(3pm) β€” go forth and generate some gorgeous session ids, ily, bye πŸ’…βœ¨

πŸ“¦ where this page comes from