• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / atala-prism-building-blocks / 8145761569

04 Mar 2024 07:15PM UTC coverage: 31.187% (-0.1%) from 31.311%
8145761569

Pull #917

shotexa
Fix minor bugs

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
Pull Request #917: feat(pollux): check verification status on presentation verification

34 of 139 new or added lines in 10 files covered. (24.46%)

408 existing lines in 114 files now uncovered.

4228 of 13557 relevant lines covered (31.19%)

0.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/shared/src/main/scala/io/iohk/atala/shared/utils/BytesOps.scala
1
package io.iohk.atala.shared.utils
2

3
import java.nio.charset.StandardCharsets
4

5
object BytesOps {
1✔
6
  private val HexArray = "0123456789abcdef".getBytes(StandardCharsets.US_ASCII);
7

8
  // Converts hex string to bytes representation
1✔
9
  def hexToBytes(hexEncoded: String): Array[Byte] = {
1✔
10
    require(hexEncoded.length % 2 == 0, "Hex length needs to be even")
×
11
    hexEncoded.grouped(2).toVector.map(hexToByte).toArray
12
  }
13

14
  // Converts bytes to hex string representation
1✔
15
  def bytesToHex(bytes: Iterable[Byte]): String = {
1✔
UNCOV
16
    val hexChars = new Array[Byte](bytes.size * 2)
×
17
    for ((byte, i) <- bytes.zipWithIndex) {
18
      val v = byte & 0xff
1✔
19
      hexChars(i * 2) = HexArray(v >>> 4)
1✔
20
      hexChars(i * 2 + 1) = HexArray(v & 0x0f)
21
    }
1✔
22
    new String(hexChars, StandardCharsets.UTF_8)
23
  }
24

1✔
25
  private def hexToByte(h: String): Byte = {
1✔
26
    Integer.parseInt(h, 16).toByte
27
  }
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc