diff --git a/src/core/n-strings.c b/src/core/n-strings.c index 2a34e11b59..c1b0545bda 100644 --- a/src/core/n-strings.c +++ b/src/core/n-strings.c @@ -203,7 +203,7 @@ static struct digest { data = VAL_BIN_DATA(arg); } - if (sym > SYM_CRC32 && sym <= SYM_SHA512) { + if (sym > SYM_CRC32 && sym <= SYM_RIPEMD160) { // O: could be optimized using index computed from `sym` // find matching digest: for (i = 0; i < sizeof(digests) / sizeof(digests[0]); i++) { diff --git a/src/tests/units/checksum-test.r3 b/src/tests/units/checksum-test.r3 index 9956d375a6..0ffc8bdb0f 100644 --- a/src/tests/units/checksum-test.r3 +++ b/src/tests/units/checksum-test.r3 @@ -172,7 +172,27 @@ D2079D59D6984814DAC71CDEB38097DB52F77810391FD7B6F92FFBD64EA93DF8 --assert port? update port --assert sum1 = port/data close port - +if find system/catalog/checksums 'ripemd160 [ + ;@@ https://github.com/Oldes/Rebol-issues/issues/2516 + --test-- "checksum-port-ripemd160" + port: open checksum:ripemd160 + sum1: checksum bin 'ripemd160 + sum2: checksum join bin bin 'ripemd160 + --assert #{595FEC4966B173C6CD00ECCAF1A007F3C6C5B938} = sum1 + --assert port? port + --assert open? port + --assert 'ripemd160 = port/spec/method + --assert port? write port bin + --assert sum1 = read port + --assert port? write port bin + --assert sum2 = read port + --assert sum2 = read port + --assert not open? close port + --assert port? write open port bin + --assert port? update port + --assert sum1 = port/data + close port +] --test-- "checksum-write-refinements" port: open checksum:// write/part port bin 1