also fix MD5
This commit is contained in:
30
src/commonTest/kotlin/com/infendro/hash/md/MD5.kt
Normal file
30
src/commonTest/kotlin/com/infendro/hash/md/MD5.kt
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.infendro.hash.md
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertContentEquals
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class `MD5 Test` {
|
||||
val function = MD5
|
||||
|
||||
@Test
|
||||
fun `bytes and block`() {
|
||||
assertEquals(16, function.bytes)
|
||||
assertEquals(128, function.bits)
|
||||
assertEquals(64, function.block)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `empty bytearray`() {
|
||||
val expected = ubyteArrayOf(
|
||||
0xd4U, 0x1dU, 0x8cU, 0xd9U,
|
||||
0x8fU, 0x00U, 0xb2U, 0x04U,
|
||||
0xe9U, 0x80U, 0x09U, 0x98U,
|
||||
0xecU, 0xf8U, 0x42U, 0x7eU,
|
||||
)
|
||||
val actual = function.hash(
|
||||
ubyteArrayOf()
|
||||
)
|
||||
assertContentEquals(expected, actual)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user