Object...gnature(3pm)

πŸ“¦
version 1.08 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Object::Signature(3pm) β€” or, how to give your objects a glow-up fingerprint πŸ’–

okay bestie, gather round, because this one is so cute and also extremely useful. This is the manual for Object::Signature, a lil Perl module from the User Contributed Perl Documentation corner of the world. No cap, it does exactly one thing and it does it adorably. πŸŽ€


✨ NAME ✨

Object::Signature β€” generate cryptographic signatures for objects. it's giving "your object but make it a fingerprint." πŸ’…


🌸 SYNOPSIS 🌸

here's the whole vibe, copy-paste ready, no notes:

# In your module
package My::Module
use base 'Object::Signature';

# In outside code
my $Object = My::Module->new;
print "Object Signature: " . $Object->signature;

like. that's it. that's the whole relationship. inherit, call, get signature. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So Object::Signature is an abstract base class β€” meaning you don't use it directly, you inherit from it β€” and once you do, your objects can generate their own unique cryptographic signatures. main character energy fr fr. πŸ‘‘

How does it cook the signature, you ask? The method is built on top of Storable and Digest::MD5. Here's the tea:

  • your object gets fed into Storable::nfreeze, which hands back a string
  • that string gets passed to Digest::MD5::md5_hex
  • and boom ✨ you get a unique 32 character hexadecimal signature

literally iconic. πŸ“


πŸ’… METHODS πŸ’…

signature

The signature method is the only method this module adds to your class β€” it's a one-trick pony and the trick slays. Call it on any object and it will generate a unique 32 hexadecimal signature for that object. no cap. πŸ”₯


🌈 SUPPORT 🌈

If something's broken, don't suffer in silence bestie β€” all bugs should be filed via the bug tracker at

<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Object-Signature>

And for other issues, or if you need commercial enhancement or support, just contact the author. they're nice, promise. πŸ’œ


πŸŽ€ TO DO πŸŽ€

(this is the "someday, maybe" section. manifesting. 🧚)

Incremental Generation

Right now it has to generate the entire Storable string before it can digest it. Would be nice if there was a way to incrementally Storablise and Digest in one pass, so it becomes way more memory efficient for large objects. lowkey a future upgrade, highkey needed. 😭

Strengthen the Digest Algorithm

Once the current (as of 2005) hashing controversy settles down, the plan is to consider selecting a newer and more powerful hashing algorithm to replace MD5. Or, alternatively, offer alternatives depending on how important the security situation is β€” because MD5 is very fast (90 meg a second) and many more-secure ones are a lot slower (more than 10 times slower in some cases). πŸ’€

On our side is the fact we use Storable. It should be much harder to create collisions when you don't control the string, only the structure before it goes through Storable. so like, small mercies, but mercies nonetheless. πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org>


⭐ SEE ALSO ⭐

iykyk. πŸ’–


Copyright 2004 - 2011 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.


okay that's the whole page bestie, you're officially certified in object signatures now πŸŽ“πŸ’– this was perl v5.28.0, dated 2018-11-21, and it's the Object::Signature page β€” slay, go freeze some objects, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from