Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smsManager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
smsManager
Commits
9cc37d57
Commit
9cc37d57
authored
Jun 11, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correccion de digito verificador
parent
49390613
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
23 deletions
+5
-23
src/AppBundle/Model/UsuarioMcafee.php
src/AppBundle/Model/UsuarioMcafee.php
+5
-23
No files found.
src/AppBundle/Model/UsuarioMcafee.php
View file @
9cc37d57
...
...
@@ -104,29 +104,11 @@ class UsuarioMcafee extends BaseUsuarioMcafee {
}
}
public
function
getDv
()
{
$x
=
2
;
$sumatorio
=
0
;
for
(
$i
=
strlen
(
$rut
)
-
1
;
$i
>
0
;
$i
--
)
{
if
(
$x
>
7
)
{
$x
=
2
;
}
$sumatorio
=
$sumatorio
+
(
$rut
[
$i
]
*
$x
);
$x
++
;
}
$digito
=
bcmod
(
$sumatorio
,
11
);
$digito
=
11
-
$digito
;
switch
(
$digito
)
{
case
10
:
$digito
=
"K"
;
break
;
case
11
:
$digito
=
"0"
;
break
;
}
return
$digito
;
public
function
getDv
(
$r
)
{
$s
=
1
;
for
(
$m
=
0
;
$r
!=
0
;
$r
/=
10
)
$s
=
(
$s
+
$r
%
10
*
(
9
-
$m
++
%
6
))
%
11
;
return
chr
(
$s
?
$s
+
47
:
75
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment