File tree Expand file tree Collapse file tree 2 files changed +20
-30
lines changed Expand file tree Collapse file tree 2 files changed +20
-30
lines changed Original file line number Diff line number Diff line change @@ -37,36 +37,6 @@ Constructors
37
37
38
38
Create an MD5 hasher object and optionally feed ``data `` into it.
39
39
40
- .. only :: port_wipy
41
-
42
- .. class :: uhashlib.sha1([data[, block_size]])
43
-
44
- Create a sha1 hasher object and optionally feed ``data `` or ``data and block_size `` into it.
45
-
46
- .. class :: uhashlib.sha256([data[, block_size]])
47
-
48
- Create a sha256 hasher object and optionally feed ``data `` or ``data and block_size `` into it.
49
-
50
- .. admonition :: CPython extension
51
- :class: attention
52
-
53
- Due to hardware implementation details of the WiPy, data must be buffered before being
54
- digested, which would make it impossible to calculate the hash of big blocks of data that
55
- do not fit in RAM. In this case, since most likely the total size of the data is known
56
- in advance, the size can be passed to the constructor and hence the HASH hardware engine
57
- of the WiPy can be properly initialized without needing buffering. If ``block_size `` is
58
- to be given, an initial chunk of ``data `` must be passed as well. **When using this extension,
59
- care must be taken to make sure that the length of all intermediate chunks (including the
60
- initial one) is a multiple of 4 bytes. ** The last chunk may be of any length.
61
-
62
- Example::
63
-
64
- hash = uhashlib.sha1('abcd1234', 1001) # length of the initial piece is multiple of 4 bytes
65
- hash.update('1234') # also multiple of 4 bytes
66
- ...
67
- hash.update('12345') # last chunk may be of any length
68
- hash.digest()
69
-
70
40
Methods
71
41
-------
72
42
Original file line number Diff line number Diff line change @@ -253,3 +253,23 @@ SSL sockets need to be created the following way before wrapping them with.
253
253
import ssl
254
254
s = socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
255
255
ss = ssl.wrap_socket(s)
256
+
257
+ Incompatibilities in uhashlib module
258
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259
+
260
+ Due to hardware implementation details of the WiPy, data must be buffered before being
261
+ digested, which would make it impossible to calculate the hash of big blocks of data that
262
+ do not fit in RAM. In this case, since most likely the total size of the data is known
263
+ in advance, the size can be passed to the constructor and hence the HASH hardware engine
264
+ of the WiPy can be properly initialized without needing buffering. If ``block_size `` is
265
+ to be given, an initial chunk of ``data `` must be passed as well. **When using this extension,
266
+ care must be taken to make sure that the length of all intermediate chunks (including the
267
+ initial one) is a multiple of 4 bytes. ** The last chunk may be of any length.
268
+
269
+ Example::
270
+
271
+ hash = uhashlib.sha1('abcd1234', 1001) # length of the initial piece is multiple of 4 bytes
272
+ hash.update('1234') # also multiple of 4 bytes
273
+ ...
274
+ hash.update('12345') # last chunk may be of any length
275
+ hash.digest()
You can’t perform that action at this time.
0 commit comments