diff --git a/CTng/GZip/GZipComp.go b/CTng/GZip/GZipComp.go deleted file mode 100644 index 18c4460..0000000 --- a/CTng/GZip/GZipComp.go +++ /dev/null @@ -1,64 +0,0 @@ -package GZIP64 - -import ( - "time" -) - -//GZip File that saves a header storing data about the decompressed/compressed gzip file - -type Header struct { - Comment string // comment - Extra []byte // "extra data" - ModTime time.Time // modification time - Name string // file name - OS byte // operating system type -} - -//Functions for Gzip - || Gzip is a fast compression format in HTTPS communication. - -// func main() { -// test := "this is an example string for testing compression levels" -// test += " here is some more example text" - -// // Write with BestSpeed. - -// fmt.Println("BESTSPEED") - -// f, _ := os.Create("C:\\programs\\file-crv-speed.gz") // Create new gzip write file - -// w, _ := gzip.NewWriterLevel(f, gzip.BestSpeed) - -// w.Write([]byte(test)) //test -// w.Close() //close writing with BestSpeed - -// // Write with BestCompression. - -// fmt.Println("BESTCOMPRESSION") - -// f, _ = os.Create("C:\\programs\\file-crv-bestcompression.gz") - -// w, _ = gzip.NewWriterLevel(f, gzip.BestCompression) - -// w.Write([]byte(test)) - -// w.Close() -// } - -//BestCompression and Best Speed - -/*func main() { - - f, _ := os.Open("") //open our gzip file - - reader, _ := gzip.NewReader(f) //Creates reader to decompress gzip - - final := make([]byte, 100) // Empty byte slice - - count, _ := reader.Read(final) //iterate/ read data - - // print final decompressed data - - fmt.Println(count) - fmt.Println(string(final)) - -}*/ diff --git a/CTng/GZip/Readme.md b/CTng/GZip/Readme.md new file mode 100644 index 0000000..15ded58 --- /dev/null +++ b/CTng/GZip/Readme.md @@ -0,0 +1,16 @@ +# GZIP Implementation + +## Contents: +- `Decode.go`: defines the decode and encode functions +- `GZipbyte.go`: contains the compress function +- `GZipDecomp.go`: contains the decompression function + +## Decode.go: +- Decode takes in bytes, decompresses them, then returns the decoded string if successful, error if not +- Encode takes in bytes, compresses them, then returns an encoded string if successful, error if not + +## GZipbyte.go: +- When given a bytes it will compress them and return compressed bytes + +## GZipDecomp.go: +- Decompresses the the compressed bytes to readable data diff --git a/CTng/config/ReadMe.md b/CTng/config/ReadMe.md index bc5fea7..d2891b3 100644 --- a/CTng/config/ReadMe.md +++ b/CTng/config/ReadMe.md @@ -2,8 +2,8 @@ ## Contents: - `types.go`: defines the gossiper and monitor structs which will be be populated by config files (json files) -- `config_loaders.go`: implementation of k-of-n threshold signatures using a BLS library. -- `config/test`: Creates slightly simplified+application specific RSA functions from go's "crypto/rsa" library. +- `config_loaders.go`: contains functions that load configuration settings from json files +- `config/test`: contains the json files that are used for testing ## config_loaders.go: - Loads the config files for both monitor and gossiper