Yet Another OTP generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UtilsTest.kt 494B

123456789101112131415161718
  1. package com.chameth.yaotp.algos
  2. import com.natpryce.hamkrest.assertion.assert
  3. import com.natpryce.hamkrest.equalTo
  4. import org.junit.Test
  5. class UtilsTest {
  6. @Test
  7. fun testHmacSha1_withKnownValues() {
  8. val key = "key".toByteArray()
  9. val input = "The quick brown fox jumps over the lazy dog".toByteArray()
  10. val expected = "de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9"
  11. assert.that(hmacSha1(key, input).toHexString(), equalTo(expected))
  12. }
  13. }