Data::...:UUID16(3pm)

πŸ’– Data::...:UUID16 β€” like, the Data::Session::ID::UUID16 manual page πŸ’–

okay bestie, so this is the page for Data::Session::ID::UUID16 (the 3pm one, yes, we're doing perl docs, slay), and honestly? it's a whole vibe. it's the little module that lets Data::Session spit out session ids using Data::UUID. short page, big energy. let's get into it πŸ¦‹


✨ NAME ✨

Data::Session::ID::UUID16 β€” a persistent session manager. that's the whole name. iconic. πŸ’…


🌸 Synopsis 🌸

See Data::Session for details.

that's it. that's the synopsis. go read your other manpage, bestie, this one's shy πŸ™ˆ


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

See "Case-sensitive Options" in Data::Session for important information. (fr fr, go look, it matters.)

To use this module do this:

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

like, you literally just tell it "hey, use id:UUID16" and you're in business ✨


πŸ‘‘ Description πŸ‘‘

Data::Session::ID::UUID16 allows Data::Session to generate session ids using Data::UUID.

that's the gig. it's the id-generator plug-in. it does one thing and it does it well, periodt.


πŸ’œ Method: new()

Creates a new object of type Data::Session::ID::UUID16.

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

ngl bestie, the original really does say "some of which might mandatory" β€” we're keeping it exactly as written, no cap. that's the doc, not a typo we're allowed to fix. 🫢

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 yeah, one single key. minimalism. main character energy but make it quiet. 🧚


πŸ”₯ Method: generate()

Generates the next session id, or dies if it can't. (yes, dies β€” dramatic, but that's just perl being perl πŸ’€)

The algorithm is Data::UUID -> new -> create_bin.

Returns the new id.

Note: A UUID16 hex string is not necessarily a valid UTF8 string, so you can't use UUID16 to generate ids which are to be stored in a Postgres table if the database was created like this (in psql):
create database a_db owner an_owner encoding 'UTF8';
Warning: This also means you should never try to use 'driver:File;id:UUID16;...', since the ids generated by this module would rarely if ever be valid as a part of a file name.

okay so real talk, these two caveats are the important bits β€” like, do NOT come crying to me when your UTF8 Postgres or your file-name-driver situation explodes 😭. read the note, read the warning, then proceed. that's the vibe check.


🌈 Method: id_length()

Returns 16 because that's the number of bytes in a UUID16 digest.

This can be used to generate the SQL to create the sessions table.

See scripts/digest.pl.

sixteen bytes. cute round number. we love her. πŸ’–


🫢 Support 🫢

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

found a bug? don't be shy, log it there, bestie. that's the whole support channel.


⭐ Author ⭐

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

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

shoutout to Ron Savage, the original author, holding it down since 2010 πŸ‘‘


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

so yeah, OSI Certified Open Source Software, Artistic License, go read it if you're gonna redistribute or modify. legal stuff, but make it cute. πŸŽ€


and that's the page!! written by Ron Savage, this doc shipped as perl v5.36.0, dated 2023-02-14 (valentine's day, how romantic πŸ’–), and it lives at Data::...:UUID16(3pm). bye bestie, go generate some ids βœ¨πŸ¦‹

πŸ“¦ where this page comes from