All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scodec.protocols.MacAddress.scala Maven / Gradle / Ivy

The newest version!
package scodec.protocols

import scodec.bits.ByteVector
import scodec.Codec
import scodec.codecs.bytes

case class MacAddress(value: ByteVector) {
  require(value.length == 6)
}

object MacAddress {
  implicit val codec: Codec[MacAddress] = bytes(6).xmap[MacAddress](v => MacAddress(v), _.value)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy