LdapTools\Security\GUID::parseSection PHP Method

parseSection() protected method

Return the specified section of the hexadecimal string.
protected parseSection ( $hex, array $sections, boolean $octet = false ) : string
$hex string The full hex string.
$sections array An array of start and length (unless octet is true, then length is always 2).
$octet boolean Whether this is for octet string form.
return string The concatenated sections in upper-case.
    protected function parseSection($hex, array $sections, $octet = false)
    {
        $parsedString = '';
        foreach ($sections as $section) {
            $start = $octet ? $section : $section[0];
            $length = $octet ? 2 : $section[1];
            $parsedString .= substr($hex, $start, $length);
        }
        return $parsedString;
    }