--- a/SHA1Stream.st Thu Mar 04 15:33:35 2010 +0100
+++ b/SHA1Stream.st Thu Mar 04 15:33:51 2010 +0100
@@ -333,16 +333,7 @@
"
Test Vectors (from FIPS PUB 180-1); results are:
- 'abc'
- -> A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
-
- 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'
- -> 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
-
- A million repetitions of 'a'
- -> 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
-
- [exBegin]
+ [exBegin]
|hashStream|
hashStream := SHA1Stream new.
@@ -350,16 +341,16 @@
hashStream hashValue printOn:Transcript base:16. Transcript cr.
hashStream nextPut:'dbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'.
hashStream hashValue printOn:Transcript base:16. Transcript cr.
- [exEnd]
+ [exEnd]
- [exBegin]
+ [exBegin]
|hashValue|
hahValue := SHA1Stream hashValueOf:'abc'.
hashValue printOn:Transcript base:16. Transcript cr.
- [exEnd]
+ [exEnd]
- [exBegin]
+ [exBegin]
|hashStream|
hashStream := SHA1Stream new.
@@ -368,47 +359,47 @@
hashStream nextPut:'dbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq' asByteArray.
hashStream hashValue printOn:Transcript base:16. Transcript cr.
- [exEnd]
+ [exEnd]
- [exBegin]
+ [exBegin]
|hashStream|
hashStream := SHA1Stream new.
1000000 timesRepeat:[ hashStream nextPut:$a ].
hashStream hashValue printOn:Transcript base:16. Transcript cr.
- [exEnd]
+ [exEnd]
- [exBegin]
+ [exBegin]
|hashStream|
hashStream := SHA1Stream new.
hashStream nextPut:'a'.
hashStream hashValue printOn:Transcript base:16. Transcript cr.
- [exEnd]
+ [exEnd]
- [exBegin]
+ [exBegin]
|hashStream|
hashStream := SHA1Stream new.
hashStream nextPut:$a.
hashStream hashValue printOn:Transcript base:16. Transcript cr.
- [exEnd]
+ [exEnd]
timing throughput:
- [exBegin]
+ [exBegin]
|hashStream n t|
hashStream := SHA1Stream new.
n := 1000000.
t := Time millisecondsToRun:[
- n timesRepeat:[
- hashStream nextPutAll:'12345678901234567890123456789012345678901234567890'.
- ].
- ].
+ n timesRepeat:[
+ hashStream nextPutAll:'12345678901234567890123456789012345678901234567890'.
+ ].
+ ].
t := (t / 1000) asFloat.
Transcript show:t; show:' seconds for '; show:(50*n/1024) asFloat; showCR:' Kb'.
Transcript show:(n*50/1024 / t); showCR:' Kb/s'
- [exEnd]
+ [exEnd]
"
! !
@@ -682,11 +673,11 @@
!SHA1Stream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.17 2009-11-02 18:40:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.18 2010-03-04 14:33:51 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.17 2009-11-02 18:40:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.18 2010-03-04 14:33:51 cg Exp $'
! !
SHA1Stream initialize!