File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff 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+
248262class 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
You can’t perform that action at this time.
0 commit comments