HashStream.st
changeset 23381 e02ede0d6d8d
parent 22564 097f48409054
child 24268 ec6569c964a0
equal deleted inserted replaced
23380:11b767acd056 23381:e02ede0d6d8d
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1999 by eXept Software AG
     4  COPYRIGHT (c) 1999 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   232 
   234 
   233 digestMessage:aStringOrByteArrayOrStream
   235 digestMessage:aStringOrByteArrayOrStream
   234     ^ self hashValueOf:aStringOrByteArrayOrStream
   236     ^ self hashValueOf:aStringOrByteArrayOrStream
   235 !
   237 !
   236 
   238 
       
   239 hashValueHexString:aString
       
   240     | hash |
       
   241     
       
   242     hash := self hashValueOf:aString.
       
   243     ^ hash hexPrintString asLowercase
       
   244 
       
   245     "
       
   246      MD5Stream hashValueHexString:'abc'
       
   247     "
       
   248 
       
   249     "Created: / 23-09-2018 / 03:44:21 / Claus Gittinger"
       
   250 !
       
   251 
   237 hashValueOf:aStringOrByteArrayOrStream
   252 hashValueOf:aStringOrByteArrayOrStream
   238     |hashStream|
   253     |hashStream|
   239 
   254 
   240     hashStream := self new.
   255     hashStream := self new.
   241     aStringOrByteArrayOrStream isStream ifTrue:[
   256     aStringOrByteArrayOrStream isStream ifTrue:[