package gs.std.v0.core

import java.util.HexFormat

/** Implementation of [[Encoder]] for Hexadecimal strings.
  */
object HexEncoder extends Encoder[Hex]:

  private lazy val h: HexFormat = HexFormat.of()

  /** @inheritDocs
    */
  override def encode(input: Array[Byte]): Hex =
    Hex(h.formatHex(input))

  /** @inheritDocs
    */
  override def encode(input: Vector[Byte]): Hex =
    Hex(h.formatHex(input.toArray))
