Skip to content

Instantly share code, notes, and snippets.

@pravdomil
pravdomil / checksum-mirror.go
Created July 9, 2025 17:07
A Go utility for macOS that uses extended attributes to store and verify per-file SHA-256 checksums in two directories, providing a simple RAID-1-style mirror with built-in integrity checking.
package main
import (
"bytes"
"crypto/sha256"
"errors"
"flag"
"fmt"
"io"
"os"
@pravdomil
pravdomil / checksum.go
Last active July 9, 2025 14:27
A Go CLI that computes, verifies and initializes SHA-256 checksums for files on macOS by storing the digest in the user.checksum.sha256 extended attribute.
package main
import (
"bytes"
"crypto/sha256"
"errors"
"fmt"
"io"
"os"
"path/filepath"