Skip to content

Commit

Permalink
formata uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokum committed Dec 5, 2023
1 parent 81b3838 commit d3ff880
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -1219,16 +1219,12 @@ public static function validarCnpjCpf($documento)
*/
public static function formatarUUID($uuid)
{
$uuid = self::onlyNumbers($uuid);

return sprintf(
'%s-%s-%s-%s-%s',
substr($uuid, 0, 8),
substr($uuid, 8, 4),
substr($uuid, 12, 4),
substr($uuid, 16, 4),
substr($uuid, 20, 12)
);
$uuidNew = self::onlyNumbers($uuid);
if (preg_match('/[a-zA-Z0-9]{32}/', $uuidNew)) {
return Util::maskString($uuidNew, '########-####-####-####-############');
}

return $uuid;
}

/**
Expand Down

0 comments on commit d3ff880

Please sign in to comment.