From 288f09478fc13f08e3673344ce505228c6ab91c2 Mon Sep 17 00:00:00 2001 From: Ishan Goel Date: Mon, 20 Dec 2021 13:43:55 -0800 Subject: [PATCH] update release --- .goreleaser.yml | 4 ++-- README.md | 8 +++++++- aces.go | 18 +++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 76fa66a..1d4dad7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,8 +16,8 @@ builds: - 386 ldflags: - -s -w - ignore: # problems with build https://github.com/golang/go/issues/39033 - - goos: darwin + ignore: # problems with build + - goos: windows goarch: arm64 archives: - replacements: diff --git a/README.md b/README.md index a3b40aa..bcc494b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [comment]: <> (**A**ny **C**haracter **E**ncoding **S**et) Any Character Encoding Set -Aces is a command line utility that lets you encode any file to a character set of your choice. +Aces is a command line utility that lets you encode any data to a character set of your choice. For example, you could encode "Foo Bar" to a combination of these four characters: "HhAa", resulting in this ~~hilarious~~ sequence of laughs: ```text @@ -21,6 +21,12 @@ If you're on macOS, you can even convert that output to speech: echo -n "Matthew Stanciu" | aces HhAa | say ``` +Make your own wacky encoding: +```shell +$ echo HELLO WORLD | aces "DORK BUM" +RRD RBO RKD M DRBU MBRRRKD RDOR +``` + With Aces, you can see the actual 0s and 1s of files: ```shell aces 01 < $(which echo) diff --git a/aces.go b/aces.go index f0758cf..154d9be 100644 --- a/aces.go +++ b/aces.go @@ -89,6 +89,12 @@ func main() { return } + //b, err := ioutil.ReadAll(os.Stdin) + //fmt.Println("yooooo") + //fmt.Printf("%x", sha256.Sum256(b)) + //return + + //fmt.Println("ok") bs := bitStreamer{chunkLen: numOfBits, in: os.Stdin} err := bs.init() if err != nil { @@ -97,16 +103,21 @@ func main() { res := make([]byte, 0, 2*1024) for { chunk, err := bs.next() + //fmt.Print(chunk, ";") if err != nil { if err == io.EOF { + //fmt.Println("rune set: ", encodeHaHa) + //fmt.Println("triggered write2") os.Stdout.Write(res) - os.Stdout.WriteString("\n") + //os.Stdout.WriteString("\n") + os.Stdout.Close() return } panic(err) } - res = append(res, []byte(string(encodeHaHa[chunk]))...) - if len(res) > 1024 { + res = append(res, string(encodeHaHa[chunk])...) + if len(res) > 1024*7/2 { + //fmt.Println("triggered write") os.Stdout.Write(res) res = make([]byte, 0, 2*1024) } @@ -159,6 +170,7 @@ func (bs *bitStreamer) next() (b byte, e error) { currByte := bs.buf[byteNum] didChange := false if byteNum+1 >= bs.bufN { // unlikely + //fmt.Println("OMG OMG OMG OMG HELLO HELLO") didChange = true eh := make([]byte, 1) _, err := bs.in.Read(eh) // the actual data size doesn't change so we won't change n