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

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

01 Jun 2023 07:46AM UTC coverage: 27.329%. Remained the same
5141710482

push

atala-dev
chore(release): cut atala prism 1.4.0 release

# [1.4.0](https://github.com/input-output-hk/atala-prism-building-blocks/compare/prism-agent-v1.3.0...prism-agent-v1.4.0) (2023-06-01)

### Bug Fixes

* **prism-agent:** infinite loop in proof presentation execution ([#540](https://github.com/input-output-hk/atala-prism-building-blocks/issues/540)) ([6a26bb7](https://github.com/input-output-hk/atala-prism-building-blocks/commit/6a26bb78d))

### Features

* **prism-agent:** add support for hierarchical deterministic key with seed ([#534](https://github.com/input-output-hk/atala-prism-building-blocks/issues/534)) ([6129baf](https://github.com/input-output-hk/atala-prism-building-blocks/commit/6129baf12))

2426 of 8877 relevant lines covered (27.33%)

0.27 hits per line

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

0.0
/mercury/mercury-library/agent-cli-didcommx/src/main/scala/io/iohk/atala/QRcode.scala
1
package io.iohk.atala
2

3
import com.google.zxing.BarcodeFormat;
4
import com.google.zxing.EncodeHintType;
5
import com.google.zxing.MultiFormatWriter;
6
import com.google.zxing.WriterException;
7
import com.google.zxing.common.BitMatrix;
8
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
9
import java.util.Hashtable
10

11
object QRcode {
12

×
13
  def getQr(text: String) = {
14
    val width = 40
15
    val height = 40
×
16
    val qrParam = new Hashtable[EncodeHintType, Object]()
×
17
    qrParam.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L)
×
18
    qrParam.put(EncodeHintType.CHARACTER_SET, "utf-8")
×
19
    try {
×
20
      val bitMatrix: BitMatrix = new MultiFormatWriter().encode(text, BarcodeFormat.QR_CODE, width, height, qrParam);
×
21
      toAscii(bitMatrix)
×
22
    } catch case e: WriterException => e.printStackTrace()
23
  }
24

×
25
  def toAscii(bitMatrix: BitMatrix) =
×
26
    val sb = new StringBuilder()
×
27
    for (rows <- 0 to bitMatrix.getHeight - 1)
×
28
      for (cols <- 0 to bitMatrix.getWidth - 1)
×
29
        if (!bitMatrix.get(rows, cols))
×
30
          sb.append("  ") // white
×
31
        else sb.append("██") // black
×
32
      sb.append("\n")
×
33
    sb.toString()
34

35
}
36

×
37
@main def QRcodeMain() = {
38
  val text = "https://localhost:8000/?_oob=asfyukfuhgkflajfl"
×
39
  System.out.println(QRcode.getQr(text))
40
}
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