1Crypt::Digest::RIPEMD25U6s(e3r)Contributed Perl DocumentCartyipotn::Digest::RIPEMD256(3)
2
3
4

NAME

6       Crypt::Digest::RIPEMD256 - Hash function RIPEMD-256 [size: 256 bits]
7

SYNOPSIS

9          ### Functional interface:
10          use Crypt::Digest::RIPEMD256 qw( ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u
11                                       ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u );
12
13          # calculate digest from string/buffer
14          $ripemd256_raw  = ripemd256('data string');
15          $ripemd256_hex  = ripemd256_hex('data string');
16          $ripemd256_b64  = ripemd256_b64('data string');
17          $ripemd256_b64u = ripemd256_b64u('data string');
18          # calculate digest from file
19          $ripemd256_raw  = ripemd256_file('filename.dat');
20          $ripemd256_hex  = ripemd256_file_hex('filename.dat');
21          $ripemd256_b64  = ripemd256_file_b64('filename.dat');
22          $ripemd256_b64u = ripemd256_file_b64u('filename.dat');
23          # calculate digest from filehandle
24          $ripemd256_raw  = ripemd256_file(*FILEHANDLE);
25          $ripemd256_hex  = ripemd256_file_hex(*FILEHANDLE);
26          $ripemd256_b64  = ripemd256_file_b64(*FILEHANDLE);
27          $ripemd256_b64u = ripemd256_file_b64u(*FILEHANDLE);
28
29          ### OO interface:
30          use Crypt::Digest::RIPEMD256;
31
32          $d = Crypt::Digest::RIPEMD256->new;
33          $d->add('any data');
34          $d->addfile('filename.dat');
35          $d->addfile(*FILEHANDLE);
36          $result_raw  = $d->digest;     # raw bytes
37          $result_hex  = $d->hexdigest;  # hexadecimal form
38          $result_b64  = $d->b64digest;  # Base64 form
39          $result_b64u = $d->b64udigest; # Base64 URL Safe form
40

DESCRIPTION

42       Provides an interface to the RIPEMD256 digest algorithm.
43

EXPORT

45       Nothing is exported by default.
46
47       You can export selected functions:
48
49         use Crypt::Digest::RIPEMD256 qw(ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u
50                                             ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u);
51
52       Or all of them at once:
53
54         use Crypt::Digest::RIPEMD256 ':all';
55

FUNCTIONS

57   ripemd256
58       Logically joins all arguments into a single string, and returns its
59       RIPEMD256 digest encoded as a binary string.
60
61        $ripemd256_raw = ripemd256('data string');
62        #or
63        $ripemd256_raw = ripemd256('any data', 'more data', 'even more data');
64
65   ripemd256_hex
66       Logically joins all arguments into a single string, and returns its
67       RIPEMD256 digest encoded as a hexadecimal string.
68
69        $ripemd256_hex = ripemd256_hex('data string');
70        #or
71        $ripemd256_hex = ripemd256_hex('any data', 'more data', 'even more data');
72
73   ripemd256_b64
74       Logically joins all arguments into a single string, and returns its
75       RIPEMD256 digest encoded as a Base64 string, with trailing '=' padding.
76
77        $ripemd256_b64 = ripemd256_b64('data string');
78        #or
79        $ripemd256_b64 = ripemd256_b64('any data', 'more data', 'even more data');
80
81   ripemd256_b64u
82       Logically joins all arguments into a single string, and returns its
83       RIPEMD256 digest encoded as a Base64 URL Safe string (see RFC 4648
84       section 5).
85
86        $ripemd256_b64url = ripemd256_b64u('data string');
87        #or
88        $ripemd256_b64url = ripemd256_b64u('any data', 'more data', 'even more data');
89
90   ripemd256_file
91       Reads file (defined by filename or filehandle) content, and returns its
92       RIPEMD256 digest encoded as a binary string.
93
94        $ripemd256_raw = ripemd256_file('filename.dat');
95        #or
96        $ripemd256_raw = ripemd256_file(*FILEHANDLE);
97
98   ripemd256_file_hex
99       Reads file (defined by filename or filehandle) content, and returns its
100       RIPEMD256 digest encoded as a hexadecimal string.
101
102        $ripemd256_hex = ripemd256_file_hex('filename.dat');
103        #or
104        $ripemd256_hex = ripemd256_file_hex(*FILEHANDLE);
105
106       BEWARE: You have to make sure that the filehandle is in binary mode
107       before you pass it as argument to the addfile() method.
108
109   ripemd256_file_b64
110       Reads file (defined by filename or filehandle) content, and returns its
111       RIPEMD256 digest encoded as a Base64 string, with trailing '=' padding.
112
113        $ripemd256_b64 = ripemd256_file_b64('filename.dat');
114        #or
115        $ripemd256_b64 = ripemd256_file_b64(*FILEHANDLE);
116
117   ripemd256_file_b64u
118       Reads file (defined by filename or filehandle) content, and returns its
119       RIPEMD256 digest encoded as a Base64 URL Safe string (see RFC 4648
120       section 5).
121
122        $ripemd256_b64url = ripemd256_file_b64u('filename.dat');
123        #or
124        $ripemd256_b64url = ripemd256_file_b64u(*FILEHANDLE);
125

METHODS

127       The OO interface provides the same set of functions as Crypt::Digest.
128
129   new
130        $d = Crypt::Digest::RIPEMD256->new();
131
132   clone
133        $d->clone();
134
135   reset
136        $d->reset();
137
138   add
139        $d->add('any data');
140        #or
141        $d->add('any data', 'more data', 'even more data');
142
143   addfile
144        $d->addfile('filename.dat');
145        #or
146        $d->addfile(*FILEHANDLE);
147
148   add_bits
149        $d->add_bits($bit_string);   # e.g. $d->add_bits("111100001010");
150        #or
151        $d->add_bits($data, $nbits); # e.g. $d->add_bits("\xF0\xA0", 16);
152
153   hashsize
154        $d->hashsize;
155        #or
156        Crypt::Digest::RIPEMD256->hashsize();
157        #or
158        Crypt::Digest::RIPEMD256::hashsize();
159
160   digest
161        $result_raw = $d->digest();
162
163   hexdigest
164        $result_hex = $d->hexdigest();
165
166   b64digest
167        $result_b64 = $d->b64digest();
168
169   b64udigest
170        $result_b64url = $d->b64udigest();
171

SEE ALSO

173       ·   CryptX, Crypt::Digest
174
175       ·   <http://en.wikipedia.org/wiki/RIPEMD>
176
177
178
179perl v5.30.1                      2020-01-29       Crypt::Digest::RIPEMD256(3)
Impressum