Permalink
Please sign in to comment.
Browse files
provide checksum script to easily generate config checksum values
- Loading branch information...
15
checksum.pl
@@ -0,0 +1,15 @@ | ||
+#!/usr/bin/perl | ||
+ | ||
+use strict; | ||
+ | ||
+while (defined $ARGV[0]) { | ||
+ my $s1 = 0; | ||
+ my $s2 = 0; | ||
+ my $str = shift @ARGV; | ||
+ | ||
+ for (split //, $str) { | ||
+ $s1 = ($s1 + (ord $_)) % 255; | ||
+ $s2 = ($s2 + $s1) % 255; | ||
+ }; | ||
+ printf "%s:\t%d\n", $str, ($s2<<8) + $s1; | ||
+} |
0 comments on commit
b195040