Skip to content

Instantly share code, notes, and snippets.

@fd0

fd0/main.go Secret

Last active November 28, 2018 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fd0/bf984e1c40b56eaeff310d07a0d71128 to your computer and use it in GitHub Desktop.
Save fd0/bf984e1c40b56eaeff310d07a0d71128 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"io"
"os"
"github.com/restic/chunker"
)
func main() {
chk := chunker.New(os.Stdin, 0x3dea92648f6e83)
buf := make([]byte, 16*1024*1024) // 16 MiB
for {
chunk, err := chk.Next(buf)
if err == io.EOF {
break
}
if err != nil {
panic(err)
}
fmt.Printf("%d\t%d\t%016x\n", chunk.Start, chunk.Length, chunk.Cut)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment