MCPcopy Create free account
hub / github.com/Effect-TS/effect / macAddressFromOctets

Function macAddressFromOctets

packages/effect/src/net/NetAddress.ts:908–915  ·  view source on GitHub ↗
(
  octets: MacAddressOctets
)

Source from the content-addressed store, hash-verified

906 * @since 4.0.0
907 */
908export const macAddressFromOctets = (
909 octets: MacAddressOctets
910): Result.Result<MacAddress, NetAddressError> => {
911 if (!allIntegersInRange(octets, 255)) {
912 return addressError(octets, "octets must be integers from 0 through 255")
913 }
914 return Result.succeed(makeMac(new Uint8Array(octets)))
915}
916
917/**
918 * Parses a colon-separated MAC address containing six two-digit hexadecimal octets.

Callers 1

macAddressFromInputFunction · 0.85

Calls 4

allIntegersInRangeFunction · 0.85
addressErrorFunction · 0.85
makeMacFunction · 0.70
succeedMethod · 0.45

Tested by

no test coverage detected