Yet Another OTP generator
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. }