Skip to content

Instantly share code, notes, and snippets.

View deplinenoise's full-sized avatar

Andreas Fredriksson deplinenoise

View GitHub Profile
@deplinenoise
deplinenoise / sum-bootblock.pl
Created June 5, 2011 08:14
Perl bootblock checksummer
#! /usr/bin/env perl -w
use strict 'subs';
use bytes;
sub checksum(\$) {
my $data = shift;
my $sum = 0;
for (my $i = 0; $i < 1024; $i += 4) {
$sum += unpack('N', substr($$data, $i, 4));
@deplinenoise
deplinenoise / sum-bootblock.scm
Created June 5, 2011 08:13
R6RS bootblock checksummer
#! /usr/bin/env racket
#lang r6rs
(import (rnrs base (6))
(rnrs programs (6))
(rnrs io ports (6))
(rnrs io simple (6))
(rnrs arithmetic bitwise (6))
(rnrs bytevectors (6)))