-
Install the package with the command
go get https://github.com/PretendoNetwork/ASH0
-
Import the
ash0
package into your project
import (
"github/PretendoNetwork/ASH0"
)
- Load your ash0 file into a uint8 slice
// Note: myFuncThatLoadsAFileIntoAByteSlice() is not included with the ash0 package
data := myFuncThatLoadsAFileIntoAByteSlice("myfile.ash")
- (Optional) Check if the file is a compressed ash0 file
if !ash0.IsAshCompressed(data) {
// Oh no! It's not a compressed ash0 file!
}
- Decompress the file
out := ash0.Decompress(data)
- If you're running the code on a big endian machine, be sure to set the
IsLittleEndian
boolean to false - There's a lot of pointer arithmetic in the source code, so if VSCode warns you about
Possible misuse of unsafe.Pointer
, just laugh it off - If you have any questions feel free to ask me in the Pretendo discord (make sure to ping me @Nybbit#5412)