Skip to content

Commit 4fd4e86

Browse files
committed
re-order examples
1 parent d2027d6 commit 4fd4e86

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

demos/demo_dynamic.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,20 @@ def digest(self):
245245
LTC.sha256_done(byref(self.state), byref(md))
246246
return md.raw
247247

248+
# - - - - - - - - - - - - -
249+
# a SHA256 app fragment
250+
251+
if SHOW_SHA256_EXAMPLE:
252+
print('-'*60)
253+
data = b'hello world' # we want bytes, not Unicode
254+
255+
sha256 = SHA256()
256+
sha256.update(data)
257+
md = sha256.digest()
258+
259+
template = '\n the SHA256 digest for "%s" is %s \n'
260+
print(template % (data, hexlify(md)))
261+
248262
class ChaCha(object):
249263
def __init__(self, key, rounds):
250264
self.state = c_buffer(_get_size(b'chacha_state'))
@@ -263,20 +277,6 @@ def crypt(self, datain):
263277
raise Exception('LTC.chacha_crypt(), err = %d, "%s"' % (err, _err2str(err)))
264278
return dataout.raw
265279

266-
# - - - - - - - - - - - - -
267-
# a SHA256 app fragment
268-
269-
if SHOW_SHA256_EXAMPLE:
270-
print('-'*60)
271-
data = b'hello world' # we want bytes, not Unicode
272-
273-
sha256 = SHA256()
274-
sha256.update(data)
275-
md = sha256.digest()
276-
277-
template = '\n the SHA256 digest for "%s" is %s \n'
278-
print(template % (data, hexlify(md)))
279-
280280
# - - - - - - - - - - - - -
281281
# a ChaCha app fragment
282282

0 commit comments

Comments
 (0)