Permalink
Browse files

Add a Ruby script to get the latest CRC definitions.

getcrcs will extract all of the CRC definitions from Greg Cook's
CRC catalog (or catalogue as he calls it), which is at
http://reveng.sourceforge.net/crc-catalogue/all.htm . The result
of this script is the file allcrcs.txt in this distribution, as
of the last time it was run.
  • Loading branch information...
1 parent 3369bdb commit 5bdbb2c7903e97a76c9387681c4e3f9ea141f3bf @madler committed Jul 29, 2016
Showing with 7 additions and 0 deletions.
  1. +7 −0 getcrcs
View
@@ -0,0 +1,7 @@
+#!/usr/bin/ruby -w
+# Get all of the CRC definitions from Greg Cook's CRC catalog.
+require 'open-uri'
+cat = "http://reveng.sourceforge.net/crc-catalogue/all.htm"
+open(cat).each do |line|
+ line.match(/<code>\s*(width=.*)\s*<\/code>/i) { puts $1.squeeze(' ') }
+end

0 comments on commit 5bdbb2c

Please sign in to comment.