Skip to content

Commit 9de9f6e

Browse files
committed
Code the encoder and the decoder, compile them, etc.
0 parents  commit 9de9f6e

File tree

12 files changed

+542
-0
lines changed

12 files changed

+542
-0
lines changed

bin/GoFileEncoder.exe

2.4 MB
Binary file not shown.

build.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
echo Building...
3+
go build -o .\bin\GoFileEncoder.exe .\src\
4+
echo Built

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!bin/bash
2+
3+
echo "Building..."
4+
go build -o ./bin/GoFileEncoder ./src/
5+
echo "Built"

buildrun.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
call .\build.bat
3+
.\bin\GoFileEncoder.exe

buildrun.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!bin/bash
2+
./build.sh
3+
./bin/GoFileEncoder

go.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module GoFileEncoder
2+
3+
go 1.24.2
4+
5+
require github.com/sqweek/dialog v0.0.0-20240226140203-065105509627
6+
7+
require github.com/TheTitanrain/w32 v0.0.0-20200114052255-2654d97dbd3d // indirect

go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf h1:FPsprx82rdrX2jiKyS17BH6IrTmUBYqZa/CXT4uvb+I=
2+
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf/go.mod h1:peYoMncQljjNS6tZwI9WVyQB3qZS6u79/N3mBOcnd3I=
3+
github.com/TheTitanrain/w32 v0.0.0-20200114052255-2654d97dbd3d h1:2xp1BQbqcDDaikHnASWpVZRjibOxu7y9LhAv04whugI=
4+
github.com/TheTitanrain/w32 v0.0.0-20200114052255-2654d97dbd3d/go.mod h1:peYoMncQljjNS6tZwI9WVyQB3qZS6u79/N3mBOcnd3I=
5+
github.com/sqweek/dialog v0.0.0-20240226140203-065105509627 h1:2JL2wmHXWIAxDofCK+AdkFi1KEg3dgkefCsm7isADzQ=
6+
github.com/sqweek/dialog v0.0.0-20240226140203-065105509627/go.mod h1:/qNPSY91qTz/8TgHEMioAUc6q7+3SOybeKczHMXFcXw=

run.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
.\bin\GoFileEncoder.exe

run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!bin/bash
2+
./bin/GoFileEncoder

src/GoFileEncoder.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package main
2+
3+
import (
4+
"GoFileEncoder/src/decoder"
5+
"GoFileEncoder/src/encoder"
6+
"fmt"
7+
"strings"
8+
"time"
9+
)
10+
11+
func main() {
12+
fmt.Print("Que voulez-vous faire ?\n - Encoder un fichier (e)\n - Décoder un fichier (d)\n")
13+
var rep string = ""
14+
15+
for !(rep == "e" || rep == "d") {
16+
fmt.Print("(e/d)>>>")
17+
fmt.Scanf("%s\n", &rep)
18+
rep = strings.ToLower(rep)
19+
time.Sleep(300 * time.Millisecond)
20+
}
21+
22+
switch rep {
23+
case "e":
24+
encoder.Encoder()
25+
case "d":
26+
decoder.Decoder()
27+
}
28+
}

0 commit comments

Comments
 (0)