1Data::Printer::Filter::UDsiegresCto(n3t)ributed Perl DocDuamtean:t:aPtriionnter::Filter::Digest(3)
2
3
4
6 Data::Printer::Filter::Digest - pretty-printing MD5, SHA and many other
7 digests
8
10 In your ".dataprinter" file:
11
12 filters = Digest
13
14 You may also setup the look and feel with the following options:
15
16 filter_digest.show_class_name = 0
17 filter_digest.show_reset = 1
18
19 # you can even customize your themes:
20 colors.digest = #27ac3c
21
22 That's it!
23
25 This is a filter plugin for Data::Printer. It filters through several
26 message digest objects and displays their current value in hexadecimal
27 format as a string.
28
29 Parsed Modules
30 Any module that inherits from Digest::base. The following ones are
31 actively supported:
32
33 • Digest::Adler32
34
35 • Digest::MD2
36
37 • Digest::MD4
38
39 • Digest::MD5
40
41 • Digest::SHA
42
43 • Digest::SHA1
44
45 • Digest::Whirlpool
46
47 If you have any suggestions for more modules or better output, please
48 let us know.
49
50 Extra Options
51 Aside from the display color, there are a few other options to be
52 customized via the "filter_digest" option key:
53
54 show_class_name
55
56 If set to true (the default) the class name will be displayed right
57 next to the hexadecimal digest.
58
59 show_reset
60
61 If set to true (the default), the filter will add a "[reset]" tag after
62 dumping an empty digest object. See the rationale below.
63
64 Note on dumping Digest::* objects
65 The digest operation is effectively a destructive, read-once operation.
66 Once it has been performed, most Digest::* objects are automatically
67 reset and can be used to calculate another digest value.
68
69 This behaviour - or, rather, forgetting about this behaviour - is a
70 common source of issues when working with Digests.
71
72 This Data::Printer filter will not destroy your object. Instead, we
73 work on a cloned version to display the hexdigest, leaving your
74 original object untouched.
75
76 As another debugging convenience for developers, since the empty object
77 will produce a digest even after being used, this filter adds by
78 default a "[reset]" tag to indicate that the object is empty, in a
79 'reset' state - i.e. its hexdigest is the same as the hexdigest of a
80 new, empty object of that same class.
81
83 Data::Printer
84
85
86
87perl v5.38.0 2023-07-31 Data::Printer::Filter::Digest(3)