temperaturecontrol: allow setting background tool without activating
[clinton/Smoothieware.git] / checksum.pl
CommitLineData
b195040c
MM
1#!/usr/bin/perl
2
3use strict;
4
5while (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}