Skip to content

Commit

Permalink
add result of matrix examples in README also change matrix_print func…
Browse files Browse the repository at this point in the history
…tion for print matrix more precise
  • Loading branch information
KaisenAmin committed Jun 19, 2024
1 parent 0c70589 commit a775d18
Show file tree
Hide file tree
Showing 11 changed files with 527 additions and 80 deletions.
Binary file modified build/encoding.dll
Binary file not shown.
Binary file modified build/fmt.dll
Binary file not shown.
Binary file modified build/matrix.dll
Binary file not shown.
Binary file modified build/random.dll
Binary file not shown.
Binary file modified build/string.dll
Binary file not shown.
Binary file modified build/time.dll
Binary file not shown.
22 changes: 11 additions & 11 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def compile_to_shared_library(directory, build_dir, openssl_include_path, openss
def compile_project(run_after_compile=False, compile_to_shared_only=False, program_args=[]):
source_directories = [
# "numeric",
"algorithm",
# "algorithm",
# "array",
"bitset",
# "bitset",
# "config",
# "csv",
# "deque",
Expand All @@ -90,23 +90,23 @@ def compile_project(run_after_compile=False, compile_to_shared_only=False, progr
# "json",
# "file_io",
# "log",
"priority_queue",
"queue",
"span",
"stack",
# "priority_queue",
# "queue",
# "span",
# "stack",
"string",
# "network",
"vector",
# "time",
# "vector",
"time",
# "concurrent",
# "date",
# "dir",
# "cli",
# "crypto",
"tuple",
# "matrix",
# "tuple",
"matrix",
# "database",
# "random",
"random",
# "statistics",
# "sysinfo",
]
Expand Down
1 change: 1 addition & 0 deletions encoding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ int main() {
if (decoded) {
fmt_printf("Base16 Encoded: %s\n", encodedText);
fmt_printf("Decoded: %s\n", decoded);

free(decoded);
}
return 0;
Expand Down
33 changes: 8 additions & 25 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
#include <stdlib.h>
#include <string.h>
#include "matrix/matrix.h"
#include "fmt/fmt.h"
#include "encoding/encoding.h"


int main() {
const char* input = "Hello, Base91!";
size_t input_length = strlen(input);
Matrix* matrix = matrix_walsh(8);

// Encoding
char* encoded = encoding_base91_encode((const uint8_t*)input, input_length);
if (!encoded) {
fmt_fprintf(stderr, "Encoding failed.\n");
return 1;
if (!matrix) {
fmt_printf("Error in creation matrix object");
return -1;
}

fmt_printf("Encoded: %s\n", encoded);

// Decoding
size_t decoded_length;
uint8_t* decoded = encoding_base91_decode(encoded, &decoded_length);

if (!decoded) {
fmt_fprintf(stderr, "Decoding failed.\n");
free(encoded);
return 1;
}
fmt_printf("Decoded: %.*s\n", (int)decoded_length, decoded);
fmt_printf("Matrix walsh is : \n");
matrix_print(matrix);

free(encoded);
free(decoded);
matrix_deallocate(matrix);
return 0;
}
Loading

0 comments on commit a775d18

Please sign in to comment.