Prefix
in package
Table of Contents
Constants
- L2_REGEX_WITH_OPTIONAL_PREFIX = '/^(AS)?[A-Fa-f\d]{64}$/'
- Regular expression for matching a UMID/L2 address with or without the "AS" prefix.
Methods
- prefixWithAS() : string
- Ensures a UMID/L2 address has exactly one "AS" prefix. It is idempotent.
- removeASPrefix() : string
- Ensures a UMID/L2 address doesn't have an "AS" prefix. It is idempotent.
Constants
L2_REGEX_WITH_OPTIONAL_PREFIX
Regular expression for matching a UMID/L2 address with or without the "AS" prefix.
private
mixed
L2_REGEX_WITH_OPTIONAL_PREFIX
= '/^(AS)?[A-Fa-f\d]{64}$/'
Methods
prefixWithAS()
Ensures a UMID/L2 address has exactly one "AS" prefix. It is idempotent.
public
static prefixWithAS(string $umid) : string
Parameters
- $umid : string
-
The UMID/L2 address to check and potentially prefix.
Tags
Return values
string —The UMID/L2 address with the "AS" prefix.
removeASPrefix()
Ensures a UMID/L2 address doesn't have an "AS" prefix. It is idempotent.
public
static removeASPrefix(string $umid) : string
APIYes
Parameters
- $umid : string
-
The UMID/L2 address to check and potentially remove the prefix from.
Tags
Return values
string —The UMID/L2 address without the "AS" prefix.