<commit_before><?php

namespace RybakDigital\Bundle\UserBundle\Doctrine;

use Doctrine\ORM\Id\AbstractIdGenerator;
use Doctrine\ORM\EntityManager;
use Ucc\Crypt\Hash;

/**
 * RybakDigital\Bundle\UserBundle\Doctrine\GuidGenerator
 *
 * @author <NAME> <<EMAIL>>
 */
class GuidGenerator extends AbstractIdGenerator
{
    public function generate(EntityManager $em, $entity, $length = 10)
    {
        $entityName = $em->getClassMetadata(get_class($entity))->getName();

        // Number of times before random generator will give up
        $maxAttempts    = 100;
        $attempt        = 0;

        while (true) {
            $id = Hash::generateSalt($length, false);
            $item = $em->getRepository($entityName)->findOneByGuid($id);

            if (!$item) {<commit_msg>Increases default size of guid<commit_after><?php

namespace RybakDigital\Bundle\UserBundle\Doctrine;

use Doctrine\ORM\Id\AbstractIdGenerator;
use Doctrine\ORM\EntityManager;
use Ucc\Crypt\Hash;

/**
 * RybakDigital\Bundle\UserBundle\Doctrine\GuidGenerator
 *
 * @author <NAME> <<EMAIL>>
 */
class GuidGenerator extends AbstractIdGenerator
{
    public function generate(EntityManager $em, $entity, $length = 11)
    {
        $entityName = $em->getClassMetadata(get_class($entity))->getName();

        // Number of times before random generator will give up
        $maxAttempts    = 100;
        $attempt        = 0;

        while (true) {
            $id = Hash::generateSalt($length, false);
            $item = $em->getRepository($entityName)->findOneByGuid($id);

            if (!$item) {
{'fraction_non_alphanumeric': 0.12919569347688412, 'fraction_numerical': 0.007599746675110829, 'mean_word_length': 3.1253263707571803, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6480306', 'n_tokens_mistral': 489, 'n_tokens_neox': 461, 'n_words': 100}