HCoop
/
clinton
/
Smoothieware.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
get direct step running from encoder
[clinton/Smoothieware.git]
/
checksum.pl
1
#!/usr/bin/perl
2
3
use
strict
;
4
5
while
(
defined
$ARGV
[
0
]) {
6
my
$s1
=
0
;
7
my
$s2
=
0
;
8
my
$str
=
shift
@ARGV
;
9
10
for
(
split
//
,
$str
) {
11
$s1
= (
$s1
+ (
ord
$_
)) %
255
;
12
$s2
= (
$s2
+
$s1
) %
255
;
13
};
14
printf
"
%s
:
\t
%d
\n
"
,
$str
, (
$s2
<<
8
) +
$s1
;
15
}