summaryrefslogtreecommitdiff
path: root/src/gps-cksum
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-06-04 10:41:34 -0700
committerKeith Packard <keithp@keithp.com>2009-06-04 10:41:34 -0700
commit210dbaa23cdacf3a6f2d6e23493e96ee2ac9bca7 (patch)
tree42dbabd0caa7186c898da746014341d3ff31a201 /src/gps-cksum
parent8cce307bb3156584ba17ae5a787f645dfee5fb94 (diff)
Use autotools, move altos to src subdir
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/gps-cksum')
-rwxr-xr-xsrc/gps-cksum17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gps-cksum b/src/gps-cksum
new file mode 100755
index 00000000..a08153bf
--- /dev/null
+++ b/src/gps-cksum
@@ -0,0 +1,17 @@
+#!/usr/bin/env nickle
+
+int checksum(string a)
+{
+ int c = 0;
+ for (int i = 0; i < String::length(a); i++)
+ c ^= a[i];
+ return c;
+}
+
+void main()
+{
+ for (int i = 1; i < dim(argv); i++)
+ printf ("$%s*%02x\n", argv[i], checksum(argv[i]));
+}
+
+main();