@param string $uuid

@return string
353162
public function reduce(string $uuid): string
    {
        $dictionaryLength = $this->dictionary->getLength();
        $uuidInt = $this->converter->fromHex($uuid);
        $output = '';

        while ($uuidInt->getValue() > 0) {
            $previousNumber = clone $uuidInt;
            $uuidInt = $uuidInt->divide($dictionaryLength);
            $digit = $previousNumber->mod($dictionaryLength);
            $output .= $this->dictionary->getCharAt((int) $digit->getValue());
        }

        return $output;
    }
443571
public function encode(UuidInterface $uuid)
    {
        $components = array_values($uuid->getFieldsHex());

        // Swap byte-order on the first three fields
        $this->swapFields($components);

        return vsprintf(
            '%08s-%04s-%04s-%02s%02s-%012s',
            $components
        );
    }
260564
public static function getUUID() : string
    {
        mt_srand((double) microtime() * 10000);
        $charId = strtolower(md5(uniqid(rand(), true)));
        $hyphen = chr(45);
        return substr($charId, 0, 8) . $hyphen . substr($charId, 8, 4) . $hyphen . substr($charId, 12, 4) . $hyphen . substr($charId, 16, 4) . $hyphen . substr($charId, 20, 12);
    }
1035933
private static CmsUUID toUuid(String uuid) {

        if ("null".equals(uuid) || CmsStringUtil.isEmpty(uuid)) {
            return null;
        }
        return new CmsUUID(uuid);

    }
275681
public function getQuestion($uuid)
    {
        $found = null;
        foreach ($this->stepQuestions as $stepQuestion) {
            if ($stepQuestion->getQuestion()->getUuid() === $uuid) {
                $found = $stepQuestion->getQuestion();
                break;
            }
        }

        return $found;
    }
1315645
public function read($uuid)
    {
        $notification = $this->service->findByUuid($uuid);
        $this->service->markAsRead($notification->id);

        return view('notifications.show')->with('notification', $notification);
    }
876382
public function getReferences($uuid)
    {
        $session = $this->sessionManager->getSession();
        $node = $session->getNodeByIdentifier($uuid);

        return iterator_to_array($node->getReferences());
    }
775081
public function getProject($uuid)
    {
        $request = $this->client->createRequest('GET', sprintf('/api/projects/%s', $uuid));

        return $this->serializer->deserialize(
            (string) $this->send($request)->getBody(),
            'SensioLabs\Insight\Sdk\Model\Project',
            'xml'
        );
    }
799752
public static function bin($uuid) {
    if (!self::isValid($uuid)) {
      throw new Exception('The UUID provided for the namespace is not valid.');
    }

    // Get hexadecimal components of namespace
    $hex = str_replace(array('-','{','}'), '', $uuid);

    $bin = '';

    // Convert to bits
    for ($i = 0; $i < strlen($hex); $i += 2) {
        $bin .= chr(hexdec($hex[$i] . $hex[$i+1]));
    }

    return $bin;
  }
432556
public static function validate(string $uuid): bool
	{
		$uuid = str_replace(['urn:uuid:', '{', '}'], '', $uuid);

		return (bool) preg_match('/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i', $uuid);
	}
407421
public function getAction($uuid, Request $request)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        $document = $this->getDocumentManager()->find(
            $uuid,
            $locale
        );

        return $this->handleView(
            $this->view($document)->setSerializationContext(
                SerializationContext::create()
                    ->setSerializeNull(true)
                    ->setGroups(['defaultPage', 'defaultArticle', 'smallArticlePage'])
            )
        );
    }
395200
public function show($uuid)
    {
        if ($uuid instanceof Service) {
            $uuid = $uuid->getUuid();
        }

        $response = $this->httpClient->get(
            $this->getResourceUrl($uuid),
            []
        );

        return ServiceResponse::createFromHttpResponse($response);
    }
1011753
public function getStep($uuid)
    {
        foreach ($this->steps as $step) {
            if ($step->getUuid() === $uuid) {
                return $step;
            }
        }

        return null;
    }
145480
public function fromAggregate($uuid)
    {
        $stream = $this->repo->byUuid(new AggregateUuid($uuid), $this->returnType);

        return ($stream) ?: [];
    }
390890
protected function getPathsByUuids($uuids)
    {
        $paths = [];

        $where = [];
        foreach ($uuids as $uuid) {
            $where[] = sprintf('[jcr:uuid] = "%s"', $uuid);
        }

        $queryString = 'SELECT * FROM [nt:unstructured] AS a WHERE ' . implode(' OR ', $where);

        $query = $this->documentManager->createQuery($queryString);

        $result = $query->execute();

        /** @var BasePageDocument $page */
        foreach ($result as $page) {
            $paths[$page->getUuid()] = $page->getPath();
        }

        return $paths;
    }
68754
public function get($uuid)
    {
        $model = new static::$model;

        $resource = $model::with($model::$localWith)->where($model->getKeyName(), '=', $uuid)->first();

        if (! $resource) {
            throw new NotFoundHttpException('Resource \'' . class_basename(static::$model) . '\' with given UUID ' . $uuid . ' not found');
        }

        $this->authorizeUserAction('view', $resource);

        return $this->response->item($resource, $this->getTransformer());
    }
1006823
protected function prepareEventType($uuid) {
    $value = NULL;
    $terms = $this->termStorage->loadByProperties([
      'uuid' => $uuid,
    ]);

    if ($terms) {
      $value = [
        [
          'target_id' => current($terms)->id(),
        ],
      ];
    }

    return $value;
  }