8
8
9
9
~~~start-file~~~ "Checksum"
10
10
11
+ ===start-group=== "Checksum of string"
12
+ --test-- {checksum of string}
13
+ --assert #{ C000CBCECDCD2582B0418B8CF0301A8E } = checksum /method "ščř" 'md5
14
+ --assert #{ 900150983CD24FB0D6963F7D28E17F72 } = checksum /method "abc" 'md5
15
+ --test-- {checksum/part of string}
16
+ --assert #{ 900150983CD24FB0D6963F7D28E17F72 } = checksum /method/part "abc123" 'md5 3
17
+ --assert #{ 900150983CD24FB0D6963F7D28E17F72 } = checksum /method/part skip "123abc" 3 'md5 3
18
+ ===end-group===
19
+
20
+
11
21
===start-group=== "Checksum with binary key (issue #1910)"
12
22
;@@ https://github.com/rebol/rebol-issues/issues/1910
13
23
--test-- "checksum-1"
24
+ --assert #{ 800A1BC1B53CAA795F4DF39DC57652209239E1F1 }
25
+ = checksum /key "Hello world" "mykey"
14
26
--assert #{ 800A1BC1B53CAA795F4DF39DC57652209239E1F1 }
15
27
= checksum /key to binary! "Hello world" "mykey"
16
28
--assert #{ 800A1BC1B53CAA795F4DF39DC57652209239E1F1 }
@@ -20,6 +32,16 @@ Rebol [
20
32
21
33
===start-group=== "Checksum basic"
22
34
--test-- {checksum ""}
35
+ str: ""
36
+ --assert #{ da39a3ee5e6b4b0d3255bfef95601890afd80709 }
37
+ = checksum /method str 'sha1
38
+ --assert #{ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 }
39
+ = checksum /method str 'sha256
40
+ --assert #{ 38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b }
41
+ = checksum /method str 'sha384
42
+ --assert #{ cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e }
43
+ = checksum /method str 'sha512
44
+ --test-- {checksum #{} }
23
45
bin: #{}
24
46
--assert #{ da39a3ee5e6b4b0d3255bfef95601890afd80709 }
25
47
= checksum /method bin 'sha1
0 commit comments