From 3041887b95cf10f9d3cd8d75326c754b331f9573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Delabrouille?= <34384633+tdelabro@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:19:24 +0200 Subject: [PATCH] chore: rename src to packages (#312) --- README.md | 20 +++++------ Scarb.toml | 24 ++++++------- {src => packages}/ascii/README.md | 0 {src => packages}/ascii/Scarb.toml | 2 +- {src => packages}/ascii/src/integer.cairo | 0 {src => packages}/ascii/src/lib.cairo | 0 {src => packages}/ascii/src/tests.cairo | 0 .../ascii/src/tests/test_ascii_integer.cairo | 0 {src => packages}/bytes/README.md | 0 {src => packages}/bytes/Scarb.toml | 2 +- {src => packages}/bytes/src/bytes.cairo | 0 {src => packages}/bytes/src/lib.cairo | 0 {src => packages}/bytes/src/storage.cairo | 0 {src => packages}/bytes/src/tests.cairo | 0 .../bytes/src/tests/test_bytes.cairo | 0 .../bytes/src/tests/test_bytes_store.cairo | 0 {src => packages}/bytes/src/utils.cairo | 0 {src => packages}/data_structures/README.md | 8 ++--- {src => packages}/data_structures/Scarb.toml | 2 +- .../data_structures/src/array_ext.cairo | 0 .../data_structures/src/bit_array.cairo | 0 .../data_structures/src/byte_appender.cairo | 0 .../data_structures/src/byte_array_ext.cairo | 0 .../data_structures/src/byte_reader.cairo | 0 .../data_structures/src/lib.cairo | 0 .../data_structures/src/queue.cairo | 0 .../data_structures/src/span_ext.cairo | 0 .../data_structures/src/stack.cairo | 0 .../data_structures/src/tests.cairo | 0 .../data_structures/src/tests/array_ext.cairo | 0 .../data_structures/src/tests/bit_array.cairo | 0 .../src/tests/byte_appender.cairo | 0 .../src/tests/byte_array_ext.cairo | 0 .../src/tests/byte_reader.cairo | 0 .../data_structures/src/tests/queue.cairo | 0 .../data_structures/src/tests/span_ext.cairo | 0 .../data_structures/src/tests/stack.cairo | 0 .../data_structures/src/tests/vec.cairo | 0 .../data_structures/src/vec.cairo | 0 {src => packages}/encoding/README.md | 4 +-- {src => packages}/encoding/Scarb.toml | 2 +- {src => packages}/encoding/src/base64.cairo | 0 {src => packages}/encoding/src/lib.cairo | 0 .../encoding/src/reversible.cairo | 0 {src => packages}/encoding/src/rlp.cairo | 0 {src => packages}/encoding/src/sol_abi.cairo | 0 .../encoding/src/sol_abi/decode.cairo | 0 .../encoding/src/sol_abi/encode.cairo | 0 .../encoding/src/sol_abi/encode_as.cairo | 0 .../encoding/src/sol_abi/sol_bytes.cairo | 0 {src => packages}/encoding/src/tests.cairo | 0 .../encoding/src/tests/base64_felt_test.cairo | 0 .../encoding/src/tests/base64_test.cairo | 0 .../encoding/src/tests/reversible_test.cairo | 0 .../encoding/src/tests/rlp_test.cairo | 0 .../encoding/src/tests/sol_abi.cairo | 0 {src => packages}/linalg/README.md | 6 ++-- {src => packages}/linalg/Scarb.toml | 2 +- {src => packages}/linalg/src/dot.cairo | 0 {src => packages}/linalg/src/kron.cairo | 0 {src => packages}/linalg/src/lib.cairo | 0 {src => packages}/linalg/src/norm.cairo | 0 {src => packages}/linalg/src/tests.cairo | 0 .../linalg/src/tests/dot_test.cairo | 0 .../linalg/src/tests/kron_test.cairo | 0 .../linalg/src/tests/norm_test.cairo | 0 {src => packages}/math/README.md | 34 +++++++++---------- {src => packages}/math/Scarb.toml | 2 +- {src => packages}/math/src/aliquot_sum.cairo | 0 .../math/src/armstrong_number.cairo | 0 {src => packages}/math/src/bitmap.cairo | 0 .../math/src/collatz_sequence.cairo | 0 {src => packages}/math/src/ed25519.cairo | 0 .../src/extended_euclidean_algorithm.cairo | 0 {src => packages}/math/src/fast_power.cairo | 0 {src => packages}/math/src/fast_root.cairo | 0 {src => packages}/math/src/fibonacci.cairo | 0 .../math/src/gcd_of_n_numbers.cairo | 0 {src => packages}/math/src/i257.cairo | 0 .../math/src/is_power_of_two.cairo | 0 {src => packages}/math/src/is_prime.cairo | 0 {src => packages}/math/src/karatsuba.cairo | 0 {src => packages}/math/src/keccak256.cairo | 0 .../math/src/lcm_of_n_numbers.cairo | 0 {src => packages}/math/src/lib.cairo | 0 .../math/src/mod_arithmetics.cairo | 0 .../math/src/perfect_number.cairo | 0 {src => packages}/math/src/sha256.cairo | 0 {src => packages}/math/src/sha512.cairo | 0 {src => packages}/math/src/tests.cairo | 0 .../math/src/tests/aliquot_sum_test.cairo | 0 .../src/tests/armstrong_number_test.cairo | 0 .../math/src/tests/bitmap_test.cairo | 0 .../src/tests/collatz_sequence_test.cairo | 0 .../math/src/tests/ed25519_test.cairo | 0 .../extended_euclidean_algorithm_test.cairo | 0 .../math/src/tests/fast_power_test.cairo | 0 .../math/src/tests/fast_root_test.cairo | 0 .../math/src/tests/fibonacci_test.cairo | 0 .../src/tests/gcd_of_n_numbers_test.cairo | 0 .../math/src/tests/i257_test.cairo | 0 .../math/src/tests/is_power_of_two_test.cairo | 0 .../math/src/tests/is_prime_test.cairo | 0 .../math/src/tests/karatsuba_test.cairo | 0 .../src/tests/lcm_of_n_numbers_test.cairo | 0 .../math/src/tests/math_test.cairo | 0 .../math/src/tests/mod_arithmetics_test.cairo | 0 .../math/src/tests/perfect_number_test.cairo | 0 .../math/src/tests/sha256_test.cairo | 0 .../math/src/tests/sha512_test.cairo | 0 .../math/src/tests/test_keccak256.cairo | 0 .../math/src/tests/trigonometry_test.cairo | 0 .../src/tests/u512_arithmetics_test.cairo | 0 .../math/src/tests/wad_ray_math_test.cairo | 0 .../src/tests/zellers_congruence_test.cairo | 0 {src => packages}/math/src/trigonometry.cairo | 0 .../math/src/u512_arithmetics.cairo | 0 {src => packages}/math/src/wad_ray_math.cairo | 0 .../math/src/zellers_congruence.cairo | 0 {src => packages}/merkle_tree/README.md | 4 +-- {src => packages}/merkle_tree/Scarb.toml | 2 +- {src => packages}/merkle_tree/src/lib.cairo | 0 .../merkle_tree/src/merkle_tree.cairo | 0 .../merkle_tree/src/storage_proof.cairo | 2 +- {src => packages}/merkle_tree/src/tests.cairo | 0 .../src/tests/get_storage_proof.sh | 0 .../src/tests/merkle_tree_test.cairo | 0 .../src/tests/storage_proof_filter.jq | 0 .../src/tests/storage_proof_test.cairo | 0 .../src/tests/storage_proof_test_data.cairo | 0 {src => packages}/numeric/README.md | 10 +++--- {src => packages}/numeric/Scarb.toml | 2 +- {src => packages}/numeric/src/cumprod.cairo | 0 {src => packages}/numeric/src/cumsum.cairo | 0 {src => packages}/numeric/src/diff.cairo | 0 {src => packages}/numeric/src/integers.cairo | 0 .../numeric/src/interpolate.cairo | 0 {src => packages}/numeric/src/lib.cairo | 0 {src => packages}/numeric/src/tests.cairo | 0 .../numeric/src/tests/cumprod_test.cairo | 0 .../numeric/src/tests/cumsum_test.cairo | 0 .../numeric/src/tests/diff_test.cairo | 0 .../numeric/src/tests/integers_test.cairo | 0 .../src/tests/interpolate_fast_test.cairo | 0 .../numeric/src/tests/interpolate_test.cairo | 0 .../src/tests/trapezoidal_rule_test.cairo | 0 .../numeric/src/trapezoidal_rule.cairo | 0 {src => packages}/searching/README.md | 8 ++--- {src => packages}/searching/Scarb.toml | 2 +- .../searching/src/binary_search.cairo | 0 .../searching/src/bm_search.cairo | 0 .../searching/src/dijkstra.cairo | 0 .../searching/src/levenshtein_distance.cairo | 0 {src => packages}/searching/src/lib.cairo | 0 {src => packages}/searching/src/tests.cairo | 0 .../tests/binary_search_closest_test.cairo | 0 .../src/tests/binary_search_test.cairo | 0 .../searching/src/tests/bm_search_test.cairo | 0 .../searching/src/tests/dijkstra_test.cairo | 0 .../src/tests/levenshtein_distance_test.cairo | 0 {src => packages}/sorting/README.md | 6 ++-- {src => packages}/sorting/Scarb.toml | 2 +- .../sorting/src/bubble_sort.cairo | 0 {src => packages}/sorting/src/interface.cairo | 0 {src => packages}/sorting/src/lib.cairo | 0 .../sorting/src/merge_sort.cairo | 0 .../sorting/src/quick_sort.cairo | 0 {src => packages}/sorting/src/tests.cairo | 0 .../sorting/src/tests/bubble_sort_test.cairo | 0 .../sorting/src/tests/merge_sort_test.cairo | 0 .../sorting/src/tests/quick_sort_test.cairo | 0 {src => packages}/storage/README.md | 0 {src => packages}/storage/Scarb.toml | 2 +- {src => packages}/storage/src/lib.cairo | 0 {src => packages}/storage/src/list.cairo | 0 {src => packages}/storage/src/tests.cairo | 0 .../storage/src/tests/list_test.cairo | 0 {src => packages}/utils/README.md | 0 {src => packages}/utils/Scarb.toml | 2 +- {src => packages}/utils/src/fmt.cairo | 0 {src => packages}/utils/src/lib.cairo | 0 181 files changed, 75 insertions(+), 75 deletions(-) rename {src => packages}/ascii/README.md (100%) rename {src => packages}/ascii/Scarb.toml (92%) rename {src => packages}/ascii/src/integer.cairo (100%) rename {src => packages}/ascii/src/lib.cairo (100%) rename {src => packages}/ascii/src/tests.cairo (100%) rename {src => packages}/ascii/src/tests/test_ascii_integer.cairo (100%) rename {src => packages}/bytes/README.md (100%) rename {src => packages}/bytes/Scarb.toml (93%) rename {src => packages}/bytes/src/bytes.cairo (100%) rename {src => packages}/bytes/src/lib.cairo (100%) rename {src => packages}/bytes/src/storage.cairo (100%) rename {src => packages}/bytes/src/tests.cairo (100%) rename {src => packages}/bytes/src/tests/test_bytes.cairo (100%) rename {src => packages}/bytes/src/tests/test_bytes_store.cairo (100%) rename {src => packages}/bytes/src/utils.cairo (100%) rename {src => packages}/data_structures/README.md (76%) rename {src => packages}/data_structures/Scarb.toml (89%) rename {src => packages}/data_structures/src/array_ext.cairo (100%) rename {src => packages}/data_structures/src/bit_array.cairo (100%) rename {src => packages}/data_structures/src/byte_appender.cairo (100%) rename {src => packages}/data_structures/src/byte_array_ext.cairo (100%) rename {src => packages}/data_structures/src/byte_reader.cairo (100%) rename {src => packages}/data_structures/src/lib.cairo (100%) rename {src => packages}/data_structures/src/queue.cairo (100%) rename {src => packages}/data_structures/src/span_ext.cairo (100%) rename {src => packages}/data_structures/src/stack.cairo (100%) rename {src => packages}/data_structures/src/tests.cairo (100%) rename {src => packages}/data_structures/src/tests/array_ext.cairo (100%) rename {src => packages}/data_structures/src/tests/bit_array.cairo (100%) rename {src => packages}/data_structures/src/tests/byte_appender.cairo (100%) rename {src => packages}/data_structures/src/tests/byte_array_ext.cairo (100%) rename {src => packages}/data_structures/src/tests/byte_reader.cairo (100%) rename {src => packages}/data_structures/src/tests/queue.cairo (100%) rename {src => packages}/data_structures/src/tests/span_ext.cairo (100%) rename {src => packages}/data_structures/src/tests/stack.cairo (100%) rename {src => packages}/data_structures/src/tests/vec.cairo (100%) rename {src => packages}/data_structures/src/vec.cairo (100%) rename {src => packages}/encoding/README.md (97%) rename {src => packages}/encoding/Scarb.toml (92%) rename {src => packages}/encoding/src/base64.cairo (100%) rename {src => packages}/encoding/src/lib.cairo (100%) rename {src => packages}/encoding/src/reversible.cairo (100%) rename {src => packages}/encoding/src/rlp.cairo (100%) rename {src => packages}/encoding/src/sol_abi.cairo (100%) rename {src => packages}/encoding/src/sol_abi/decode.cairo (100%) rename {src => packages}/encoding/src/sol_abi/encode.cairo (100%) rename {src => packages}/encoding/src/sol_abi/encode_as.cairo (100%) rename {src => packages}/encoding/src/sol_abi/sol_bytes.cairo (100%) rename {src => packages}/encoding/src/tests.cairo (100%) rename {src => packages}/encoding/src/tests/base64_felt_test.cairo (100%) rename {src => packages}/encoding/src/tests/base64_test.cairo (100%) rename {src => packages}/encoding/src/tests/reversible_test.cairo (100%) rename {src => packages}/encoding/src/tests/rlp_test.cairo (100%) rename {src => packages}/encoding/src/tests/sol_abi.cairo (100%) rename {src => packages}/linalg/README.md (85%) rename {src => packages}/linalg/Scarb.toml (91%) rename {src => packages}/linalg/src/dot.cairo (100%) rename {src => packages}/linalg/src/kron.cairo (100%) rename {src => packages}/linalg/src/lib.cairo (100%) rename {src => packages}/linalg/src/norm.cairo (100%) rename {src => packages}/linalg/src/tests.cairo (100%) rename {src => packages}/linalg/src/tests/dot_test.cairo (100%) rename {src => packages}/linalg/src/tests/kron_test.cairo (100%) rename {src => packages}/linalg/src/tests/norm_test.cairo (100%) rename {src => packages}/math/README.md (90%) rename {src => packages}/math/Scarb.toml (93%) rename {src => packages}/math/src/aliquot_sum.cairo (100%) rename {src => packages}/math/src/armstrong_number.cairo (100%) rename {src => packages}/math/src/bitmap.cairo (100%) rename {src => packages}/math/src/collatz_sequence.cairo (100%) rename {src => packages}/math/src/ed25519.cairo (100%) rename {src => packages}/math/src/extended_euclidean_algorithm.cairo (100%) rename {src => packages}/math/src/fast_power.cairo (100%) rename {src => packages}/math/src/fast_root.cairo (100%) rename {src => packages}/math/src/fibonacci.cairo (100%) rename {src => packages}/math/src/gcd_of_n_numbers.cairo (100%) rename {src => packages}/math/src/i257.cairo (100%) rename {src => packages}/math/src/is_power_of_two.cairo (100%) rename {src => packages}/math/src/is_prime.cairo (100%) rename {src => packages}/math/src/karatsuba.cairo (100%) rename {src => packages}/math/src/keccak256.cairo (100%) rename {src => packages}/math/src/lcm_of_n_numbers.cairo (100%) rename {src => packages}/math/src/lib.cairo (100%) rename {src => packages}/math/src/mod_arithmetics.cairo (100%) rename {src => packages}/math/src/perfect_number.cairo (100%) rename {src => packages}/math/src/sha256.cairo (100%) rename {src => packages}/math/src/sha512.cairo (100%) rename {src => packages}/math/src/tests.cairo (100%) rename {src => packages}/math/src/tests/aliquot_sum_test.cairo (100%) rename {src => packages}/math/src/tests/armstrong_number_test.cairo (100%) rename {src => packages}/math/src/tests/bitmap_test.cairo (100%) rename {src => packages}/math/src/tests/collatz_sequence_test.cairo (100%) rename {src => packages}/math/src/tests/ed25519_test.cairo (100%) rename {src => packages}/math/src/tests/extended_euclidean_algorithm_test.cairo (100%) rename {src => packages}/math/src/tests/fast_power_test.cairo (100%) rename {src => packages}/math/src/tests/fast_root_test.cairo (100%) rename {src => packages}/math/src/tests/fibonacci_test.cairo (100%) rename {src => packages}/math/src/tests/gcd_of_n_numbers_test.cairo (100%) rename {src => packages}/math/src/tests/i257_test.cairo (100%) rename {src => packages}/math/src/tests/is_power_of_two_test.cairo (100%) rename {src => packages}/math/src/tests/is_prime_test.cairo (100%) rename {src => packages}/math/src/tests/karatsuba_test.cairo (100%) rename {src => packages}/math/src/tests/lcm_of_n_numbers_test.cairo (100%) rename {src => packages}/math/src/tests/math_test.cairo (100%) rename {src => packages}/math/src/tests/mod_arithmetics_test.cairo (100%) rename {src => packages}/math/src/tests/perfect_number_test.cairo (100%) rename {src => packages}/math/src/tests/sha256_test.cairo (100%) rename {src => packages}/math/src/tests/sha512_test.cairo (100%) rename {src => packages}/math/src/tests/test_keccak256.cairo (100%) rename {src => packages}/math/src/tests/trigonometry_test.cairo (100%) rename {src => packages}/math/src/tests/u512_arithmetics_test.cairo (100%) rename {src => packages}/math/src/tests/wad_ray_math_test.cairo (100%) rename {src => packages}/math/src/tests/zellers_congruence_test.cairo (100%) rename {src => packages}/math/src/trigonometry.cairo (100%) rename {src => packages}/math/src/u512_arithmetics.cairo (100%) rename {src => packages}/math/src/wad_ray_math.cairo (100%) rename {src => packages}/math/src/zellers_congruence.cairo (100%) rename {src => packages}/merkle_tree/README.md (91%) rename {src => packages}/merkle_tree/Scarb.toml (88%) rename {src => packages}/merkle_tree/src/lib.cairo (100%) rename {src => packages}/merkle_tree/src/merkle_tree.cairo (100%) rename {src => packages}/merkle_tree/src/storage_proof.cairo (98%) rename {src => packages}/merkle_tree/src/tests.cairo (100%) rename {src => packages}/merkle_tree/src/tests/get_storage_proof.sh (100%) rename {src => packages}/merkle_tree/src/tests/merkle_tree_test.cairo (100%) rename {src => packages}/merkle_tree/src/tests/storage_proof_filter.jq (100%) rename {src => packages}/merkle_tree/src/tests/storage_proof_test.cairo (100%) rename {src => packages}/merkle_tree/src/tests/storage_proof_test_data.cairo (100%) rename {src => packages}/numeric/README.md (86%) rename {src => packages}/numeric/Scarb.toml (92%) rename {src => packages}/numeric/src/cumprod.cairo (100%) rename {src => packages}/numeric/src/cumsum.cairo (100%) rename {src => packages}/numeric/src/diff.cairo (100%) rename {src => packages}/numeric/src/integers.cairo (100%) rename {src => packages}/numeric/src/interpolate.cairo (100%) rename {src => packages}/numeric/src/lib.cairo (100%) rename {src => packages}/numeric/src/tests.cairo (100%) rename {src => packages}/numeric/src/tests/cumprod_test.cairo (100%) rename {src => packages}/numeric/src/tests/cumsum_test.cairo (100%) rename {src => packages}/numeric/src/tests/diff_test.cairo (100%) rename {src => packages}/numeric/src/tests/integers_test.cairo (100%) rename {src => packages}/numeric/src/tests/interpolate_fast_test.cairo (100%) rename {src => packages}/numeric/src/tests/interpolate_test.cairo (100%) rename {src => packages}/numeric/src/tests/trapezoidal_rule_test.cairo (100%) rename {src => packages}/numeric/src/trapezoidal_rule.cairo (100%) rename {src => packages}/searching/README.md (89%) rename {src => packages}/searching/Scarb.toml (93%) rename {src => packages}/searching/src/binary_search.cairo (100%) rename {src => packages}/searching/src/bm_search.cairo (100%) rename {src => packages}/searching/src/dijkstra.cairo (100%) rename {src => packages}/searching/src/levenshtein_distance.cairo (100%) rename {src => packages}/searching/src/lib.cairo (100%) rename {src => packages}/searching/src/tests.cairo (100%) rename {src => packages}/searching/src/tests/binary_search_closest_test.cairo (100%) rename {src => packages}/searching/src/tests/binary_search_test.cairo (100%) rename {src => packages}/searching/src/tests/bm_search_test.cairo (100%) rename {src => packages}/searching/src/tests/dijkstra_test.cairo (100%) rename {src => packages}/searching/src/tests/levenshtein_distance_test.cairo (100%) rename {src => packages}/sorting/README.md (95%) rename {src => packages}/sorting/Scarb.toml (92%) rename {src => packages}/sorting/src/bubble_sort.cairo (100%) rename {src => packages}/sorting/src/interface.cairo (100%) rename {src => packages}/sorting/src/lib.cairo (100%) rename {src => packages}/sorting/src/merge_sort.cairo (100%) rename {src => packages}/sorting/src/quick_sort.cairo (100%) rename {src => packages}/sorting/src/tests.cairo (100%) rename {src => packages}/sorting/src/tests/bubble_sort_test.cairo (100%) rename {src => packages}/sorting/src/tests/merge_sort_test.cairo (100%) rename {src => packages}/sorting/src/tests/quick_sort_test.cairo (100%) rename {src => packages}/storage/README.md (100%) rename {src => packages}/storage/Scarb.toml (91%) rename {src => packages}/storage/src/lib.cairo (100%) rename {src => packages}/storage/src/list.cairo (100%) rename {src => packages}/storage/src/tests.cairo (100%) rename {src => packages}/storage/src/tests/list_test.cairo (100%) rename {src => packages}/utils/README.md (100%) rename {src => packages}/utils/Scarb.toml (91%) rename {src => packages}/utils/src/fmt.cairo (100%) rename {src => packages}/utils/src/lib.cairo (100%) diff --git a/README.md b/README.md index 2fb310ad..7cb0cebf 100644 --- a/README.md +++ b/README.md @@ -59,16 +59,16 @@ Current version can be found in the [toml file](./Scarb.toml) This repository is composed of multiple crates: -- [ASCII](./src/ascii/README.md) -- [Data Structures](./src/data_structures/README.md) -- [Encoding](./src/encoding/README.md) -- [Linalg](./src/linalg/README.md) -- [Math](./src/math/README.md) -- [Numeric](./src/numeric/README.md) -- [Searching](./src/searching/README.md) -- [Sorting](./src/sorting/README.md) -- [Storage](./src/storage/README.md) -- [Bytes](./src/bytes/README.md) +- [ASCII](./packages/ascii/README.md) +- [Data Structures](./packages/data_structures/README.md) +- [Encoding](./packages/encoding/README.md) +- [Linalg](./packages/linalg/README.md) +- [Math](./packages/math/README.md) +- [Numeric](./packages/numeric/README.md) +- [Searching](./packages/searching/README.md) +- [Sorting](./packages/sorting/README.md) +- [Storage](./packages/storage/README.md) +- [Bytes](./packages/bytes/README.md) ## Getting Started diff --git a/Scarb.toml b/Scarb.toml index 827830ed..24d1b1b4 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -1,17 +1,17 @@ [workspace] members = [ - "src/data_structures", - "src/encoding", - "src/linalg", - "src/math", - "src/merkle_tree", - "src/numeric", - "src/searching", - "src/sorting", - "src/storage", - "src/ascii", - "src/bytes", - "src/utils", + "packages/data_structures", + "packages/encoding", + "packages/linalg", + "packages/math", + "packages/merkle_tree", + "packages/numeric", + "packages/searching", + "packages/sorting", + "packages/storage", + "packages/ascii", + "packages/bytes", + "packages/utils", ] name = "alexandria" version = "0.1.0" diff --git a/src/ascii/README.md b/packages/ascii/README.md similarity index 100% rename from src/ascii/README.md rename to packages/ascii/README.md diff --git a/src/ascii/Scarb.toml b/packages/ascii/Scarb.toml similarity index 92% rename from src/ascii/Scarb.toml rename to packages/ascii/Scarb.toml index 7fabc523..480e9ea9 100644 --- a/src/ascii/Scarb.toml +++ b/packages/ascii/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_ascii" version = "0.1.0" description = "utilities for working with ascii values" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/ascii" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/packages/ascii" edition = "2023_11" [tool] diff --git a/src/ascii/src/integer.cairo b/packages/ascii/src/integer.cairo similarity index 100% rename from src/ascii/src/integer.cairo rename to packages/ascii/src/integer.cairo diff --git a/src/ascii/src/lib.cairo b/packages/ascii/src/lib.cairo similarity index 100% rename from src/ascii/src/lib.cairo rename to packages/ascii/src/lib.cairo diff --git a/src/ascii/src/tests.cairo b/packages/ascii/src/tests.cairo similarity index 100% rename from src/ascii/src/tests.cairo rename to packages/ascii/src/tests.cairo diff --git a/src/ascii/src/tests/test_ascii_integer.cairo b/packages/ascii/src/tests/test_ascii_integer.cairo similarity index 100% rename from src/ascii/src/tests/test_ascii_integer.cairo rename to packages/ascii/src/tests/test_ascii_integer.cairo diff --git a/src/bytes/README.md b/packages/bytes/README.md similarity index 100% rename from src/bytes/README.md rename to packages/bytes/README.md diff --git a/src/bytes/Scarb.toml b/packages/bytes/Scarb.toml similarity index 93% rename from src/bytes/Scarb.toml rename to packages/bytes/Scarb.toml index f8a297a0..5dcd1fb7 100644 --- a/src/bytes/Scarb.toml +++ b/packages/bytes/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_bytes" version = "0.1.0" description = "An implementation similar to Solidity bytes written in Cairo 1" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/bytes" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/packages/bytes" edition = "2023_11" [tool] diff --git a/src/bytes/src/bytes.cairo b/packages/bytes/src/bytes.cairo similarity index 100% rename from src/bytes/src/bytes.cairo rename to packages/bytes/src/bytes.cairo diff --git a/src/bytes/src/lib.cairo b/packages/bytes/src/lib.cairo similarity index 100% rename from src/bytes/src/lib.cairo rename to packages/bytes/src/lib.cairo diff --git a/src/bytes/src/storage.cairo b/packages/bytes/src/storage.cairo similarity index 100% rename from src/bytes/src/storage.cairo rename to packages/bytes/src/storage.cairo diff --git a/src/bytes/src/tests.cairo b/packages/bytes/src/tests.cairo similarity index 100% rename from src/bytes/src/tests.cairo rename to packages/bytes/src/tests.cairo diff --git a/src/bytes/src/tests/test_bytes.cairo b/packages/bytes/src/tests/test_bytes.cairo similarity index 100% rename from src/bytes/src/tests/test_bytes.cairo rename to packages/bytes/src/tests/test_bytes.cairo diff --git a/src/bytes/src/tests/test_bytes_store.cairo b/packages/bytes/src/tests/test_bytes_store.cairo similarity index 100% rename from src/bytes/src/tests/test_bytes_store.cairo rename to packages/bytes/src/tests/test_bytes_store.cairo diff --git a/src/bytes/src/utils.cairo b/packages/bytes/src/utils.cairo similarity index 100% rename from src/bytes/src/utils.cairo rename to packages/bytes/src/utils.cairo diff --git a/src/data_structures/README.md b/packages/data_structures/README.md similarity index 76% rename from src/data_structures/README.md rename to packages/data_structures/README.md index 79d6ff3f..1932df90 100644 --- a/src/data_structures/README.md +++ b/packages/data_structures/README.md @@ -1,15 +1,15 @@ # Data structures -## [Array extension](./src/array_ext.cairo) +## [Array extension](./packages/array_ext.cairo) A collection of handy functions to help with array manipulation. -## [Span extension](./src/span_ext.cairo) +## [Span extension](./packages/span_ext.cairo) A collection of handy functions to help with span manipulation. -## [Queue](./src/queue.cairo) +## [Queue](./packages/queue.cairo) The queue is used to store and manipulate a collection of elements where the elements are processed in a **first-in, first-out** (FIFO) order, the oldest element being processed first. -## [Stack](./src/stack.cairo) +## [Stack](./packages/stack.cairo) The stack is used to store and manipulate a collection of elements where the elements are processed in a **last-in, first-out** (LIFO) order, the most recently added element being processed first. diff --git a/src/data_structures/Scarb.toml b/packages/data_structures/Scarb.toml similarity index 89% rename from src/data_structures/Scarb.toml rename to packages/data_structures/Scarb.toml index 835ba1c9..e439f270 100644 --- a/src/data_structures/Scarb.toml +++ b/packages/data_structures/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_data_structures" version = "0.2.0" description = "A set of Cairo data structure libraries and algorithms" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/data_structures" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/packages/data_structures" edition = "2023_11" [tool] diff --git a/src/data_structures/src/array_ext.cairo b/packages/data_structures/src/array_ext.cairo similarity index 100% rename from src/data_structures/src/array_ext.cairo rename to packages/data_structures/src/array_ext.cairo diff --git a/src/data_structures/src/bit_array.cairo b/packages/data_structures/src/bit_array.cairo similarity index 100% rename from src/data_structures/src/bit_array.cairo rename to packages/data_structures/src/bit_array.cairo diff --git a/src/data_structures/src/byte_appender.cairo b/packages/data_structures/src/byte_appender.cairo similarity index 100% rename from src/data_structures/src/byte_appender.cairo rename to packages/data_structures/src/byte_appender.cairo diff --git a/src/data_structures/src/byte_array_ext.cairo b/packages/data_structures/src/byte_array_ext.cairo similarity index 100% rename from src/data_structures/src/byte_array_ext.cairo rename to packages/data_structures/src/byte_array_ext.cairo diff --git a/src/data_structures/src/byte_reader.cairo b/packages/data_structures/src/byte_reader.cairo similarity index 100% rename from src/data_structures/src/byte_reader.cairo rename to packages/data_structures/src/byte_reader.cairo diff --git a/src/data_structures/src/lib.cairo b/packages/data_structures/src/lib.cairo similarity index 100% rename from src/data_structures/src/lib.cairo rename to packages/data_structures/src/lib.cairo diff --git a/src/data_structures/src/queue.cairo b/packages/data_structures/src/queue.cairo similarity index 100% rename from src/data_structures/src/queue.cairo rename to packages/data_structures/src/queue.cairo diff --git a/src/data_structures/src/span_ext.cairo b/packages/data_structures/src/span_ext.cairo similarity index 100% rename from src/data_structures/src/span_ext.cairo rename to packages/data_structures/src/span_ext.cairo diff --git a/src/data_structures/src/stack.cairo b/packages/data_structures/src/stack.cairo similarity index 100% rename from src/data_structures/src/stack.cairo rename to packages/data_structures/src/stack.cairo diff --git a/src/data_structures/src/tests.cairo b/packages/data_structures/src/tests.cairo similarity index 100% rename from src/data_structures/src/tests.cairo rename to packages/data_structures/src/tests.cairo diff --git a/src/data_structures/src/tests/array_ext.cairo b/packages/data_structures/src/tests/array_ext.cairo similarity index 100% rename from src/data_structures/src/tests/array_ext.cairo rename to packages/data_structures/src/tests/array_ext.cairo diff --git a/src/data_structures/src/tests/bit_array.cairo b/packages/data_structures/src/tests/bit_array.cairo similarity index 100% rename from src/data_structures/src/tests/bit_array.cairo rename to packages/data_structures/src/tests/bit_array.cairo diff --git a/src/data_structures/src/tests/byte_appender.cairo b/packages/data_structures/src/tests/byte_appender.cairo similarity index 100% rename from src/data_structures/src/tests/byte_appender.cairo rename to packages/data_structures/src/tests/byte_appender.cairo diff --git a/src/data_structures/src/tests/byte_array_ext.cairo b/packages/data_structures/src/tests/byte_array_ext.cairo similarity index 100% rename from src/data_structures/src/tests/byte_array_ext.cairo rename to packages/data_structures/src/tests/byte_array_ext.cairo diff --git a/src/data_structures/src/tests/byte_reader.cairo b/packages/data_structures/src/tests/byte_reader.cairo similarity index 100% rename from src/data_structures/src/tests/byte_reader.cairo rename to packages/data_structures/src/tests/byte_reader.cairo diff --git a/src/data_structures/src/tests/queue.cairo b/packages/data_structures/src/tests/queue.cairo similarity index 100% rename from src/data_structures/src/tests/queue.cairo rename to packages/data_structures/src/tests/queue.cairo diff --git a/src/data_structures/src/tests/span_ext.cairo b/packages/data_structures/src/tests/span_ext.cairo similarity index 100% rename from src/data_structures/src/tests/span_ext.cairo rename to packages/data_structures/src/tests/span_ext.cairo diff --git a/src/data_structures/src/tests/stack.cairo b/packages/data_structures/src/tests/stack.cairo similarity index 100% rename from src/data_structures/src/tests/stack.cairo rename to packages/data_structures/src/tests/stack.cairo diff --git a/src/data_structures/src/tests/vec.cairo b/packages/data_structures/src/tests/vec.cairo similarity index 100% rename from src/data_structures/src/tests/vec.cairo rename to packages/data_structures/src/tests/vec.cairo diff --git a/src/data_structures/src/vec.cairo b/packages/data_structures/src/vec.cairo similarity index 100% rename from src/data_structures/src/vec.cairo rename to packages/data_structures/src/vec.cairo diff --git a/src/encoding/README.md b/packages/encoding/README.md similarity index 97% rename from src/encoding/README.md rename to packages/encoding/README.md index 9733c3b4..21a50753 100644 --- a/src/encoding/README.md +++ b/packages/encoding/README.md @@ -1,10 +1,10 @@ # Encoding -## [Base64](./src/base64.cairo) +## [Base64](./packages/base64.cairo) Base64 is a binary-to-text encoding scheme used for transferring binary data safely over media designed for text. It divides input data into 3-byte blocks, each converted into 4 ASCII characters using a specific index table. If input bytes aren't divisible by three, it's padded with '=' characters. The process is reversed for decoding. -## [Solidity ABI](./src/sol_abi.cairo) +## [Solidity ABI](./packages/sol_abi.cairo) **sol_abi** is a wrapper around `alexandria_bytes::Bytes` providing easy to use interfaces to mimic Solidity's `abi` functions. diff --git a/src/encoding/Scarb.toml b/packages/encoding/Scarb.toml similarity index 92% rename from src/encoding/Scarb.toml rename to packages/encoding/Scarb.toml index 8bbc703b..a20ca187 100644 --- a/src/encoding/Scarb.toml +++ b/packages/encoding/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_encoding" version = "0.1.0" description = "Encoding utilities" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/encoding" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/packages/encoding" edition = "2023_11" [tool] diff --git a/src/encoding/src/base64.cairo b/packages/encoding/src/base64.cairo similarity index 100% rename from src/encoding/src/base64.cairo rename to packages/encoding/src/base64.cairo diff --git a/src/encoding/src/lib.cairo b/packages/encoding/src/lib.cairo similarity index 100% rename from src/encoding/src/lib.cairo rename to packages/encoding/src/lib.cairo diff --git a/src/encoding/src/reversible.cairo b/packages/encoding/src/reversible.cairo similarity index 100% rename from src/encoding/src/reversible.cairo rename to packages/encoding/src/reversible.cairo diff --git a/src/encoding/src/rlp.cairo b/packages/encoding/src/rlp.cairo similarity index 100% rename from src/encoding/src/rlp.cairo rename to packages/encoding/src/rlp.cairo diff --git a/src/encoding/src/sol_abi.cairo b/packages/encoding/src/sol_abi.cairo similarity index 100% rename from src/encoding/src/sol_abi.cairo rename to packages/encoding/src/sol_abi.cairo diff --git a/src/encoding/src/sol_abi/decode.cairo b/packages/encoding/src/sol_abi/decode.cairo similarity index 100% rename from src/encoding/src/sol_abi/decode.cairo rename to packages/encoding/src/sol_abi/decode.cairo diff --git a/src/encoding/src/sol_abi/encode.cairo b/packages/encoding/src/sol_abi/encode.cairo similarity index 100% rename from src/encoding/src/sol_abi/encode.cairo rename to packages/encoding/src/sol_abi/encode.cairo diff --git a/src/encoding/src/sol_abi/encode_as.cairo b/packages/encoding/src/sol_abi/encode_as.cairo similarity index 100% rename from src/encoding/src/sol_abi/encode_as.cairo rename to packages/encoding/src/sol_abi/encode_as.cairo diff --git a/src/encoding/src/sol_abi/sol_bytes.cairo b/packages/encoding/src/sol_abi/sol_bytes.cairo similarity index 100% rename from src/encoding/src/sol_abi/sol_bytes.cairo rename to packages/encoding/src/sol_abi/sol_bytes.cairo diff --git a/src/encoding/src/tests.cairo b/packages/encoding/src/tests.cairo similarity index 100% rename from src/encoding/src/tests.cairo rename to packages/encoding/src/tests.cairo diff --git a/src/encoding/src/tests/base64_felt_test.cairo b/packages/encoding/src/tests/base64_felt_test.cairo similarity index 100% rename from src/encoding/src/tests/base64_felt_test.cairo rename to packages/encoding/src/tests/base64_felt_test.cairo diff --git a/src/encoding/src/tests/base64_test.cairo b/packages/encoding/src/tests/base64_test.cairo similarity index 100% rename from src/encoding/src/tests/base64_test.cairo rename to packages/encoding/src/tests/base64_test.cairo diff --git a/src/encoding/src/tests/reversible_test.cairo b/packages/encoding/src/tests/reversible_test.cairo similarity index 100% rename from src/encoding/src/tests/reversible_test.cairo rename to packages/encoding/src/tests/reversible_test.cairo diff --git a/src/encoding/src/tests/rlp_test.cairo b/packages/encoding/src/tests/rlp_test.cairo similarity index 100% rename from src/encoding/src/tests/rlp_test.cairo rename to packages/encoding/src/tests/rlp_test.cairo diff --git a/src/encoding/src/tests/sol_abi.cairo b/packages/encoding/src/tests/sol_abi.cairo similarity index 100% rename from src/encoding/src/tests/sol_abi.cairo rename to packages/encoding/src/tests/sol_abi.cairo diff --git a/src/linalg/README.md b/packages/linalg/README.md similarity index 85% rename from src/linalg/README.md rename to packages/linalg/README.md index 97fd4548..c6495f82 100644 --- a/src/linalg/README.md +++ b/packages/linalg/README.md @@ -1,13 +1,13 @@ # Linear Algebra -## [Norm](./src/norm.cairo) +## [Norm](./packages/norm.cairo) Calculate the norm of an u128 array ([see also](https://numpy.org/doc/stable/reference/generated/numpy.linalg.norm.html)). -## [Dot product](./src/dot.cairo) +## [Dot product](./packages/dot.cairo) The dot product or scalar product is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors), and returns a single number. Algebraically, the dot product is the sum of the products of the corresponding entries of the two sequences of numbers ([see also](https://en.wikipedia.org/wiki/Dot_product)). -## [Kronecker product](./src/kron.cairo) +## [Kronecker product](./packages/kron.cairo) The Kronecker product is an an algebraic operation that takes two equal-length sequences of numbers and returns an array of numbers([see also](https://numpy.org/doc/stable/reference/generated/numpy.kron.html)). diff --git a/src/linalg/Scarb.toml b/packages/linalg/Scarb.toml similarity index 91% rename from src/linalg/Scarb.toml rename to packages/linalg/Scarb.toml index f528372e..2ca95fdb 100644 --- a/src/linalg/Scarb.toml +++ b/packages/linalg/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_linalg" version = "0.1.0" description = "A set of linear algebra libraries and algorithms" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/linalg" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/packages/linalg" edition = "2023_11" [tool] diff --git a/src/linalg/src/dot.cairo b/packages/linalg/src/dot.cairo similarity index 100% rename from src/linalg/src/dot.cairo rename to packages/linalg/src/dot.cairo diff --git a/src/linalg/src/kron.cairo b/packages/linalg/src/kron.cairo similarity index 100% rename from src/linalg/src/kron.cairo rename to packages/linalg/src/kron.cairo diff --git a/src/linalg/src/lib.cairo b/packages/linalg/src/lib.cairo similarity index 100% rename from src/linalg/src/lib.cairo rename to packages/linalg/src/lib.cairo diff --git a/src/linalg/src/norm.cairo b/packages/linalg/src/norm.cairo similarity index 100% rename from src/linalg/src/norm.cairo rename to packages/linalg/src/norm.cairo diff --git a/src/linalg/src/tests.cairo b/packages/linalg/src/tests.cairo similarity index 100% rename from src/linalg/src/tests.cairo rename to packages/linalg/src/tests.cairo diff --git a/src/linalg/src/tests/dot_test.cairo b/packages/linalg/src/tests/dot_test.cairo similarity index 100% rename from src/linalg/src/tests/dot_test.cairo rename to packages/linalg/src/tests/dot_test.cairo diff --git a/src/linalg/src/tests/kron_test.cairo b/packages/linalg/src/tests/kron_test.cairo similarity index 100% rename from src/linalg/src/tests/kron_test.cairo rename to packages/linalg/src/tests/kron_test.cairo diff --git a/src/linalg/src/tests/norm_test.cairo b/packages/linalg/src/tests/norm_test.cairo similarity index 100% rename from src/linalg/src/tests/norm_test.cairo rename to packages/linalg/src/tests/norm_test.cairo diff --git a/src/math/README.md b/packages/math/README.md similarity index 90% rename from src/math/README.md rename to packages/math/README.md index 7f44d833..62fc528e 100644 --- a/src/math/README.md +++ b/packages/math/README.md @@ -1,77 +1,77 @@ # Math -## [Fast Root](./src/fast_root.cairo) +## [Fast Root](./packages/fast_root.cairo) The fast root algorithm uses Newton-Raphson method to calculate a arbitrary root of a given number (e.g., square root, cubic root, etc.). The algorithm is used to find the roots of a polynomial equation, which has applications in various areas of mathematics, including algebra, calculus, and number theory. The fast root algorithm is also used in computer science, as it can be used to solve problems involving the roots of a polynomial equation. -## [Is Power Of Two](./src/is_power_of_two.cairo) +## [Is Power Of Two](./packages/is_power_of_two.cairo) The `is_power_of_two` algorithm is used to determine whether a given positive integer is a power of two or not. -## [Fast trigonometric functions (sin, cos, tan)](./src/trigonometry.cairo) +## [Fast trigonometric functions (sin, cos, tan)](./packages/trigonometry.cairo) The trigonometric functions are a set of mathematical functions that relate the angles of a triangle to the lengths of its sides. The most common trigonometric functions are sine, cosine, and tangent. These functions are used in many areas of mathematics, including geometry, calculus, and statistics. They are also used in physics, engineering, and other sciences. Fast trigonometric functions are computational and spatial efficient, with minor errors compared to the standard trigonometric functions. Refer to http://hevi.info/tag/fast-sine-function/ for detailed information. -## [Is Prime](./src/is_prime.cairo) +## [Is Prime](./packages/is_prime.cairo) The `is_prime` algorithm is used to determine whether a given positive integer is a prime number or not. -## [Aliquot sum](./src/aliquot_sum.cairo) +## [Aliquot sum](./packages/aliquot_sum.cairo) The aliquot sum algorithm calculates the sum of proper divisors of a given positive integer, providing insight into factors and divisors of a number, and classifying it as perfect, abundant, or deficient. These classifications have applications in areas of math, including geometry, cryptography, and number theory. The algorithm is used for problem-solving and generating puzzles and games. -## [Armstrong number](./src/armstrong_number.cairo) +## [Armstrong number](./packages/armstrong_number.cairo) The Armstrong number algorithm is used to determine if a number is an Armstrong number, where the sum of its digits raised to the power of the number of digits equals the original number. The algorithm is used for problem-solving and mathematical puzzles, and has applications in number theory, discrete mathematics, and computer science, as well as in generating strong encryption keys. By identifying Armstrong numbers, the algorithm provides insight into the properties of numbers and can be used in various applications in mathematics and computer science. -## [Bitmap](./src/bitmap.cairo) +## [Bitmap](./packages/bitmap.cairo) Bitmap function to manage, search and manipulate bits efficiently. -## [Collatz sequence](./src/collatz_sequence.cairo) +## [Collatz sequence](./packages/collatz_sequence.cairo) The Collatz sequence number algorithm is a mathematical algorithm used to generate the Collatz sequence of a given positive integer. The purpose of the Collatz sequence number algorithm is to explore the behavior of the Collatz conjecture, which is a famous unsolved problem in mathematics. The conjecture states that for any positive integer, the Collatz sequence will eventually reach the number 1. The Collatz sequence number algorithm is used to generate and study these sequences, which have applications in various areas of mathematics and computer science. Additionally, the algorithm is used in generating mathematical puzzles and in teaching concepts such as iteration, recursion, and complexity theory. -## [Extended euclidean](./src/extended_euclidean_algorithm.cairo) +## [Extended euclidean](./packages/extended_euclidean_algorithm.cairo) The extended Euclidean algorithm is a mathematical algorithm used to calculate the greatest common divisor (GCD) of two numbers and to find the coefficients that satisfy the Bézout's identity, which is a relationship between the GCD and the two numbers. The purpose of the extended Euclidean algorithm is to provide a way to solve linear Diophantine equations, which are equations in which the variables must be integers. The algorithm has applications in various areas of mathematics, including number theory, cryptography, and computer science. Additionally, the algorithm is used in generating encryption keys and in solving problems related to modular arithmetic. -## [Fast power](./src/fast_power.cairo) +## [Fast power](./packages/fast_power.cairo) The fast power algorithm is a mathematical algorithm used to efficiently calculate the power of a given number. The purpose of the fast power algorithm is to reduce the number of operations required to calculate a power, making it more efficient than traditional methods. The algorithm has applications in various areas of mathematics and computer science, including cryptography, where it is used to perform exponentiation in encryption and decryption operations. The fast power algorithm is also used in programming and software development, as it can improve the efficiency of algorithms that require the calculation of powers. By reducing the number of operations required to calculate a power, the fast power algorithm provides a more efficient way to perform calculations involving powers. -## [Fibonacci](./src/fibonacci.cairo) +## [Fibonacci](./packages/fibonacci.cairo) The Fibonacci algorithm is a mathematical algorithm used to generate the Fibonacci sequence, which is a sequence of numbers where each number is the sum of the previous two. The purpose of the Fibonacci algorithm is to explore the properties and patterns of the Fibonacci sequence, which has applications in various areas of mathematics, including number theory, combinatorics, and geometry. The algorithm is also used in problem-solving and generating mathematical puzzles and games. Additionally, the Fibonacci sequence has applications in computer science and data structures, as it can be used to model recursive algorithms and to generate random numbers. -## [GCD of N numbers](./src/gcd_of_n_numbers.cairo) +## [GCD of N numbers](./packages/gcd_of_n_numbers.cairo) The GCD (Greatest Common Divisor) of n numbers algorithm is used to find the largest positive integer that divides each of the given n numbers without a remainder. The purpose of this algorithm is to determine the highest common factor of the given set of numbers. It has applications in various areas of mathematics, including number theory, algebra, and cryptography. The GCD of n numbers algorithm is used in many real-world applications, such as finding the optimal solution to a problem that requires dividing resources among multiple agents. It is also used in computer science for designing efficient algorithms that require determining common factors or multiples of numbers. -## [LCM of N numbers](./src/lcm_of_n_numbers.cairo) +## [LCM of N numbers](./packages/lcm_of_n_numbers.cairo) The LCM (Lowest Common Multiple) of n numbers algorithm is used to find the smallest positive integer that is a multiple of each of the given n numbers ([see also](https://numpy.org/doc/stable/reference/generated/numpy.lcm.html)). -## [Perfect Number Algorithm](./src/perfect_number.cairo) +## [Perfect Number Algorithm](./packages/perfect_number.cairo) The perfect number algorithm is used to determine whether a given positive integer is a perfect number or not. A perfect number is a positive integer that is equal to the sum of its proper divisors (excluding itself). The purpose of the algorithm is to identify these special numbers and to study their properties. Perfect numbers have applications in various areas of mathematics, including number theory and algebraic geometry. They are also used in cryptography and coding theory. The perfect number algorithm is important for understanding the structure of numbers and their relationships to each other, and it has been studied for centuries by mathematicians. -## [Zeller's congruence](./src/zellers_congruence.cairo) +## [Zeller's congruence](./packages/zellers_congruence.cairo) Zeller's congruence algorithm is used to determine the day of the week for a given date. The purpose of the algorithm is to provide a simple and efficient way to calculate the day of the week based on the date. It is widely used in various applications, including calendar systems, scheduling, and time management. The algorithm takes into account the year, month, and day of the given date and performs a series of mathematical calculations to determine the day of the week. By providing an easy-to-use method for calculating the day of the week, Zeller's congruence algorithm is an important tool for many industries and organizations that rely on accurate and efficient time management systems. -## [ed25519](./src/ed25519.cairo) +## [ed25519](./packages/ed25519.cairo) In public-key cryptography, Edwards-curve Digital Signature Algorithm (EdDSA) is a digital signature scheme using a variant of Schnorr signature based on twisted Edwards curves. It is designed to be faster than existing digital signature schemes without sacrificing security. -## [sha512](./src/sha512.cairo) +## [sha512](./packages/sha512.cairo) SHA-512 is from the SHA-2 family (Secure Hash Algorithm 2) which is a set of cryptographic hash functions designed by the United States National Security Agency (NSA) and first published in 2001. They are built using the Merkle–Damgård construction, from a one-way compression function itself built using the Davies–Meyer structure from a specialized block cipher. diff --git a/src/math/Scarb.toml b/packages/math/Scarb.toml similarity index 93% rename from src/math/Scarb.toml rename to packages/math/Scarb.toml index 7c948d99..797d5bf6 100644 --- a/src/math/Scarb.toml +++ b/packages/math/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_math" version = "0.2.0" description = "A set of math libraries and algorithms" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/math" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/packages/math" edition = "2023_11" [tool] diff --git a/src/math/src/aliquot_sum.cairo b/packages/math/src/aliquot_sum.cairo similarity index 100% rename from src/math/src/aliquot_sum.cairo rename to packages/math/src/aliquot_sum.cairo diff --git a/src/math/src/armstrong_number.cairo b/packages/math/src/armstrong_number.cairo similarity index 100% rename from src/math/src/armstrong_number.cairo rename to packages/math/src/armstrong_number.cairo diff --git a/src/math/src/bitmap.cairo b/packages/math/src/bitmap.cairo similarity index 100% rename from src/math/src/bitmap.cairo rename to packages/math/src/bitmap.cairo diff --git a/src/math/src/collatz_sequence.cairo b/packages/math/src/collatz_sequence.cairo similarity index 100% rename from src/math/src/collatz_sequence.cairo rename to packages/math/src/collatz_sequence.cairo diff --git a/src/math/src/ed25519.cairo b/packages/math/src/ed25519.cairo similarity index 100% rename from src/math/src/ed25519.cairo rename to packages/math/src/ed25519.cairo diff --git a/src/math/src/extended_euclidean_algorithm.cairo b/packages/math/src/extended_euclidean_algorithm.cairo similarity index 100% rename from src/math/src/extended_euclidean_algorithm.cairo rename to packages/math/src/extended_euclidean_algorithm.cairo diff --git a/src/math/src/fast_power.cairo b/packages/math/src/fast_power.cairo similarity index 100% rename from src/math/src/fast_power.cairo rename to packages/math/src/fast_power.cairo diff --git a/src/math/src/fast_root.cairo b/packages/math/src/fast_root.cairo similarity index 100% rename from src/math/src/fast_root.cairo rename to packages/math/src/fast_root.cairo diff --git a/src/math/src/fibonacci.cairo b/packages/math/src/fibonacci.cairo similarity index 100% rename from src/math/src/fibonacci.cairo rename to packages/math/src/fibonacci.cairo diff --git a/src/math/src/gcd_of_n_numbers.cairo b/packages/math/src/gcd_of_n_numbers.cairo similarity index 100% rename from src/math/src/gcd_of_n_numbers.cairo rename to packages/math/src/gcd_of_n_numbers.cairo diff --git a/src/math/src/i257.cairo b/packages/math/src/i257.cairo similarity index 100% rename from src/math/src/i257.cairo rename to packages/math/src/i257.cairo diff --git a/src/math/src/is_power_of_two.cairo b/packages/math/src/is_power_of_two.cairo similarity index 100% rename from src/math/src/is_power_of_two.cairo rename to packages/math/src/is_power_of_two.cairo diff --git a/src/math/src/is_prime.cairo b/packages/math/src/is_prime.cairo similarity index 100% rename from src/math/src/is_prime.cairo rename to packages/math/src/is_prime.cairo diff --git a/src/math/src/karatsuba.cairo b/packages/math/src/karatsuba.cairo similarity index 100% rename from src/math/src/karatsuba.cairo rename to packages/math/src/karatsuba.cairo diff --git a/src/math/src/keccak256.cairo b/packages/math/src/keccak256.cairo similarity index 100% rename from src/math/src/keccak256.cairo rename to packages/math/src/keccak256.cairo diff --git a/src/math/src/lcm_of_n_numbers.cairo b/packages/math/src/lcm_of_n_numbers.cairo similarity index 100% rename from src/math/src/lcm_of_n_numbers.cairo rename to packages/math/src/lcm_of_n_numbers.cairo diff --git a/src/math/src/lib.cairo b/packages/math/src/lib.cairo similarity index 100% rename from src/math/src/lib.cairo rename to packages/math/src/lib.cairo diff --git a/src/math/src/mod_arithmetics.cairo b/packages/math/src/mod_arithmetics.cairo similarity index 100% rename from src/math/src/mod_arithmetics.cairo rename to packages/math/src/mod_arithmetics.cairo diff --git a/src/math/src/perfect_number.cairo b/packages/math/src/perfect_number.cairo similarity index 100% rename from src/math/src/perfect_number.cairo rename to packages/math/src/perfect_number.cairo diff --git a/src/math/src/sha256.cairo b/packages/math/src/sha256.cairo similarity index 100% rename from src/math/src/sha256.cairo rename to packages/math/src/sha256.cairo diff --git a/src/math/src/sha512.cairo b/packages/math/src/sha512.cairo similarity index 100% rename from src/math/src/sha512.cairo rename to packages/math/src/sha512.cairo diff --git a/src/math/src/tests.cairo b/packages/math/src/tests.cairo similarity index 100% rename from src/math/src/tests.cairo rename to packages/math/src/tests.cairo diff --git a/src/math/src/tests/aliquot_sum_test.cairo b/packages/math/src/tests/aliquot_sum_test.cairo similarity index 100% rename from src/math/src/tests/aliquot_sum_test.cairo rename to packages/math/src/tests/aliquot_sum_test.cairo diff --git a/src/math/src/tests/armstrong_number_test.cairo b/packages/math/src/tests/armstrong_number_test.cairo similarity index 100% rename from src/math/src/tests/armstrong_number_test.cairo rename to packages/math/src/tests/armstrong_number_test.cairo diff --git a/src/math/src/tests/bitmap_test.cairo b/packages/math/src/tests/bitmap_test.cairo similarity index 100% rename from src/math/src/tests/bitmap_test.cairo rename to packages/math/src/tests/bitmap_test.cairo diff --git a/src/math/src/tests/collatz_sequence_test.cairo b/packages/math/src/tests/collatz_sequence_test.cairo similarity index 100% rename from src/math/src/tests/collatz_sequence_test.cairo rename to packages/math/src/tests/collatz_sequence_test.cairo diff --git a/src/math/src/tests/ed25519_test.cairo b/packages/math/src/tests/ed25519_test.cairo similarity index 100% rename from src/math/src/tests/ed25519_test.cairo rename to packages/math/src/tests/ed25519_test.cairo diff --git a/src/math/src/tests/extended_euclidean_algorithm_test.cairo b/packages/math/src/tests/extended_euclidean_algorithm_test.cairo similarity index 100% rename from src/math/src/tests/extended_euclidean_algorithm_test.cairo rename to packages/math/src/tests/extended_euclidean_algorithm_test.cairo diff --git a/src/math/src/tests/fast_power_test.cairo b/packages/math/src/tests/fast_power_test.cairo similarity index 100% rename from src/math/src/tests/fast_power_test.cairo rename to packages/math/src/tests/fast_power_test.cairo diff --git a/src/math/src/tests/fast_root_test.cairo b/packages/math/src/tests/fast_root_test.cairo similarity index 100% rename from src/math/src/tests/fast_root_test.cairo rename to packages/math/src/tests/fast_root_test.cairo diff --git a/src/math/src/tests/fibonacci_test.cairo b/packages/math/src/tests/fibonacci_test.cairo similarity index 100% rename from src/math/src/tests/fibonacci_test.cairo rename to packages/math/src/tests/fibonacci_test.cairo diff --git a/src/math/src/tests/gcd_of_n_numbers_test.cairo b/packages/math/src/tests/gcd_of_n_numbers_test.cairo similarity index 100% rename from src/math/src/tests/gcd_of_n_numbers_test.cairo rename to packages/math/src/tests/gcd_of_n_numbers_test.cairo diff --git a/src/math/src/tests/i257_test.cairo b/packages/math/src/tests/i257_test.cairo similarity index 100% rename from src/math/src/tests/i257_test.cairo rename to packages/math/src/tests/i257_test.cairo diff --git a/src/math/src/tests/is_power_of_two_test.cairo b/packages/math/src/tests/is_power_of_two_test.cairo similarity index 100% rename from src/math/src/tests/is_power_of_two_test.cairo rename to packages/math/src/tests/is_power_of_two_test.cairo diff --git a/src/math/src/tests/is_prime_test.cairo b/packages/math/src/tests/is_prime_test.cairo similarity index 100% rename from src/math/src/tests/is_prime_test.cairo rename to packages/math/src/tests/is_prime_test.cairo diff --git a/src/math/src/tests/karatsuba_test.cairo b/packages/math/src/tests/karatsuba_test.cairo similarity index 100% rename from src/math/src/tests/karatsuba_test.cairo rename to packages/math/src/tests/karatsuba_test.cairo diff --git a/src/math/src/tests/lcm_of_n_numbers_test.cairo b/packages/math/src/tests/lcm_of_n_numbers_test.cairo similarity index 100% rename from src/math/src/tests/lcm_of_n_numbers_test.cairo rename to packages/math/src/tests/lcm_of_n_numbers_test.cairo diff --git a/src/math/src/tests/math_test.cairo b/packages/math/src/tests/math_test.cairo similarity index 100% rename from src/math/src/tests/math_test.cairo rename to packages/math/src/tests/math_test.cairo diff --git a/src/math/src/tests/mod_arithmetics_test.cairo b/packages/math/src/tests/mod_arithmetics_test.cairo similarity index 100% rename from src/math/src/tests/mod_arithmetics_test.cairo rename to packages/math/src/tests/mod_arithmetics_test.cairo diff --git a/src/math/src/tests/perfect_number_test.cairo b/packages/math/src/tests/perfect_number_test.cairo similarity index 100% rename from src/math/src/tests/perfect_number_test.cairo rename to packages/math/src/tests/perfect_number_test.cairo diff --git a/src/math/src/tests/sha256_test.cairo b/packages/math/src/tests/sha256_test.cairo similarity index 100% rename from src/math/src/tests/sha256_test.cairo rename to packages/math/src/tests/sha256_test.cairo diff --git a/src/math/src/tests/sha512_test.cairo b/packages/math/src/tests/sha512_test.cairo similarity index 100% rename from src/math/src/tests/sha512_test.cairo rename to packages/math/src/tests/sha512_test.cairo diff --git a/src/math/src/tests/test_keccak256.cairo b/packages/math/src/tests/test_keccak256.cairo similarity index 100% rename from src/math/src/tests/test_keccak256.cairo rename to packages/math/src/tests/test_keccak256.cairo diff --git a/src/math/src/tests/trigonometry_test.cairo b/packages/math/src/tests/trigonometry_test.cairo similarity index 100% rename from src/math/src/tests/trigonometry_test.cairo rename to packages/math/src/tests/trigonometry_test.cairo diff --git a/src/math/src/tests/u512_arithmetics_test.cairo b/packages/math/src/tests/u512_arithmetics_test.cairo similarity index 100% rename from src/math/src/tests/u512_arithmetics_test.cairo rename to packages/math/src/tests/u512_arithmetics_test.cairo diff --git a/src/math/src/tests/wad_ray_math_test.cairo b/packages/math/src/tests/wad_ray_math_test.cairo similarity index 100% rename from src/math/src/tests/wad_ray_math_test.cairo rename to packages/math/src/tests/wad_ray_math_test.cairo diff --git a/src/math/src/tests/zellers_congruence_test.cairo b/packages/math/src/tests/zellers_congruence_test.cairo similarity index 100% rename from src/math/src/tests/zellers_congruence_test.cairo rename to packages/math/src/tests/zellers_congruence_test.cairo diff --git a/src/math/src/trigonometry.cairo b/packages/math/src/trigonometry.cairo similarity index 100% rename from src/math/src/trigonometry.cairo rename to packages/math/src/trigonometry.cairo diff --git a/src/math/src/u512_arithmetics.cairo b/packages/math/src/u512_arithmetics.cairo similarity index 100% rename from src/math/src/u512_arithmetics.cairo rename to packages/math/src/u512_arithmetics.cairo diff --git a/src/math/src/wad_ray_math.cairo b/packages/math/src/wad_ray_math.cairo similarity index 100% rename from src/math/src/wad_ray_math.cairo rename to packages/math/src/wad_ray_math.cairo diff --git a/src/math/src/zellers_congruence.cairo b/packages/math/src/zellers_congruence.cairo similarity index 100% rename from src/math/src/zellers_congruence.cairo rename to packages/math/src/zellers_congruence.cairo diff --git a/src/merkle_tree/README.md b/packages/merkle_tree/README.md similarity index 91% rename from src/merkle_tree/README.md rename to packages/merkle_tree/README.md index d04cdeba..3824025a 100644 --- a/src/merkle_tree/README.md +++ b/packages/merkle_tree/README.md @@ -1,6 +1,6 @@ # Merkle Tree related stuff -## [Merkle Tree](./src/merkle_tree.cairo) +## [Merkle Tree](./packages/merkle_tree.cairo) The Merkle tree algorithm is a cryptographic hashing algorithm used to create a hash tree, which is a tree data structure where each leaf node represents a data block and each non-leaf node represents a hash of its child nodes. The purpose of the Merkle tree algorithm is to provide a way to verify the integrity and authenticity of large amounts of data without needing to store the entire data set. The algorithm has applications in various areas of computer science, including cryptocurrency, file sharing, and database management. @@ -8,5 +8,5 @@ The Merkle tree algorithm is also used in creating digital signatures and verify By providing a secure and efficient way to verify data integrity, the Merkle tree algorithm is an important tool in cryptography and information security. A generic implementation is available to manage both pedersen (legacy) and poseidon hash methods. -## [Starknet Storage Proof Verifier](./src/storage_proof.cairo) +## [Starknet Storage Proof Verifier](./packages/storage_proof.cairo) Implementation of Starknet ([storage proofs](https://docs.starknet.io/documentation/architecture_and_concepts/State/starknet-state/)) returned by `pathfinder_getproof` API endpoint ([see](https://github.com/eqlabs/pathfinder/blob/main/doc/rpc/pathfinder_rpc_api.json)). \ No newline at end of file diff --git a/src/merkle_tree/Scarb.toml b/packages/merkle_tree/Scarb.toml similarity index 88% rename from src/merkle_tree/Scarb.toml rename to packages/merkle_tree/Scarb.toml index 7daebb83..a7ac76f7 100644 --- a/src/merkle_tree/Scarb.toml +++ b/packages/merkle_tree/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_merkle_tree" version = "0.1.0" description = "Merkle tree related stuff" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/src/merkle_tree" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/merkle_tree" edition = "2023_11" [tool] diff --git a/src/merkle_tree/src/lib.cairo b/packages/merkle_tree/src/lib.cairo similarity index 100% rename from src/merkle_tree/src/lib.cairo rename to packages/merkle_tree/src/lib.cairo diff --git a/src/merkle_tree/src/merkle_tree.cairo b/packages/merkle_tree/src/merkle_tree.cairo similarity index 100% rename from src/merkle_tree/src/merkle_tree.cairo rename to packages/merkle_tree/src/merkle_tree.cairo diff --git a/src/merkle_tree/src/storage_proof.cairo b/packages/merkle_tree/src/storage_proof.cairo similarity index 98% rename from src/merkle_tree/src/storage_proof.cairo rename to packages/merkle_tree/src/storage_proof.cairo index 8ddedff3..e0def38a 100644 --- a/src/merkle_tree/src/storage_proof.cairo +++ b/packages/merkle_tree/src/storage_proof.cairo @@ -74,7 +74,7 @@ pub impl ContractStateProofImpl of ContractStateProofTrait { /// Verify Starknet storage proof. For reference see: /// - ([state](https://docs.starknet.io/documentation/architecture_and_concepts/State/starknet-state/)) /// - ([pathfinder_getproof API endpoint](https://github.com/eqlabs/pathfinder/blob/main/doc/rpc/pathfinder_rpc_api.json)) -/// - ([pathfinder storage implementation](https://github.com/eqlabs/pathfinder/blob/main/crates/merkle-tree/src/tree.rs)) +/// - ([pathfinder storage implementation](https://github.com/eqlabs/pathfinder/blob/main/crates/merkle-tree/main/src/tree.rs)) /// # Arguments /// * `expected_state_commitment` - state root `proof` is going to be verified against /// * `contract_address` - `contract_address` of the value to be verified diff --git a/src/merkle_tree/src/tests.cairo b/packages/merkle_tree/src/tests.cairo similarity index 100% rename from src/merkle_tree/src/tests.cairo rename to packages/merkle_tree/src/tests.cairo diff --git a/src/merkle_tree/src/tests/get_storage_proof.sh b/packages/merkle_tree/src/tests/get_storage_proof.sh similarity index 100% rename from src/merkle_tree/src/tests/get_storage_proof.sh rename to packages/merkle_tree/src/tests/get_storage_proof.sh diff --git a/src/merkle_tree/src/tests/merkle_tree_test.cairo b/packages/merkle_tree/src/tests/merkle_tree_test.cairo similarity index 100% rename from src/merkle_tree/src/tests/merkle_tree_test.cairo rename to packages/merkle_tree/src/tests/merkle_tree_test.cairo diff --git a/src/merkle_tree/src/tests/storage_proof_filter.jq b/packages/merkle_tree/src/tests/storage_proof_filter.jq similarity index 100% rename from src/merkle_tree/src/tests/storage_proof_filter.jq rename to packages/merkle_tree/src/tests/storage_proof_filter.jq diff --git a/src/merkle_tree/src/tests/storage_proof_test.cairo b/packages/merkle_tree/src/tests/storage_proof_test.cairo similarity index 100% rename from src/merkle_tree/src/tests/storage_proof_test.cairo rename to packages/merkle_tree/src/tests/storage_proof_test.cairo diff --git a/src/merkle_tree/src/tests/storage_proof_test_data.cairo b/packages/merkle_tree/src/tests/storage_proof_test_data.cairo similarity index 100% rename from src/merkle_tree/src/tests/storage_proof_test_data.cairo rename to packages/merkle_tree/src/tests/storage_proof_test_data.cairo diff --git a/src/numeric/README.md b/packages/numeric/README.md similarity index 86% rename from src/numeric/README.md rename to packages/numeric/README.md index a8e31367..8874c135 100644 --- a/src/numeric/README.md +++ b/packages/numeric/README.md @@ -1,10 +1,10 @@ # Numerical analysis -## [Trapezoidal rule](./src/trapezoidal_rule.cairo) +## [Trapezoidal rule](./packages/trapezoidal_rule.cairo) In numerical analysis and scientific computing, the trapezoidal rule is a numerical method to solve ordinary differential equations derived from the trapezoidal rule for computing integrals ([see also](https://en.wikipedia.org/wiki/Trapezoidal_rule_(differential_equations))). -## [Interpolation](./src/interpolate.cairo) +## [Interpolation](./packages/interpolate.cairo) Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xs, ys), evaluated at x ([see also](https://numpy.org/doc/stable/reference/generated/numpy.interp.html)). Several interpolation methods are supported as follow: @@ -13,14 +13,14 @@ Several interpolation methods are supported as follow: - Constant left interpolation: ys behaves as an integer part function where each y data point extends to the left up to the next index - Constant right interpolation: ys behaves as an integer part function where each y data point extends to the right up to the next index -## [Cumsum](./src/cumsum.cairo) +## [Cumsum](./packages/cumsum.cairo) Return the cumulative sum of the elements ([see also](https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html#numpy-cumsum)). -## [Cumprod](./src/cumprod.cairo) +## [Cumprod](./packages/cumprod.cairo) Return the cumulative product of the elements ([see also](https://numpy.org/doc/stable/reference/generated/numpy.cumprod.html#numpy-cumprod)). -## [Diff](./src/diff.cairo) +## [Diff](./packages/diff.cairo) Return the discrete difference of the elements ([see also](https://numpy.org/doc/stable/reference/generated/numpy.diff.html#numpy.diff)). diff --git a/src/numeric/Scarb.toml b/packages/numeric/Scarb.toml similarity index 92% rename from src/numeric/Scarb.toml rename to packages/numeric/Scarb.toml index 0bc1dbc9..ad25b857 100644 --- a/src/numeric/Scarb.toml +++ b/packages/numeric/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_numeric" version = "0.1.0" description = "A set of numerical analysis libraries and algorithms" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/numeric" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/packages/numeric" edition = "2023_11" [tool] diff --git a/src/numeric/src/cumprod.cairo b/packages/numeric/src/cumprod.cairo similarity index 100% rename from src/numeric/src/cumprod.cairo rename to packages/numeric/src/cumprod.cairo diff --git a/src/numeric/src/cumsum.cairo b/packages/numeric/src/cumsum.cairo similarity index 100% rename from src/numeric/src/cumsum.cairo rename to packages/numeric/src/cumsum.cairo diff --git a/src/numeric/src/diff.cairo b/packages/numeric/src/diff.cairo similarity index 100% rename from src/numeric/src/diff.cairo rename to packages/numeric/src/diff.cairo diff --git a/src/numeric/src/integers.cairo b/packages/numeric/src/integers.cairo similarity index 100% rename from src/numeric/src/integers.cairo rename to packages/numeric/src/integers.cairo diff --git a/src/numeric/src/interpolate.cairo b/packages/numeric/src/interpolate.cairo similarity index 100% rename from src/numeric/src/interpolate.cairo rename to packages/numeric/src/interpolate.cairo diff --git a/src/numeric/src/lib.cairo b/packages/numeric/src/lib.cairo similarity index 100% rename from src/numeric/src/lib.cairo rename to packages/numeric/src/lib.cairo diff --git a/src/numeric/src/tests.cairo b/packages/numeric/src/tests.cairo similarity index 100% rename from src/numeric/src/tests.cairo rename to packages/numeric/src/tests.cairo diff --git a/src/numeric/src/tests/cumprod_test.cairo b/packages/numeric/src/tests/cumprod_test.cairo similarity index 100% rename from src/numeric/src/tests/cumprod_test.cairo rename to packages/numeric/src/tests/cumprod_test.cairo diff --git a/src/numeric/src/tests/cumsum_test.cairo b/packages/numeric/src/tests/cumsum_test.cairo similarity index 100% rename from src/numeric/src/tests/cumsum_test.cairo rename to packages/numeric/src/tests/cumsum_test.cairo diff --git a/src/numeric/src/tests/diff_test.cairo b/packages/numeric/src/tests/diff_test.cairo similarity index 100% rename from src/numeric/src/tests/diff_test.cairo rename to packages/numeric/src/tests/diff_test.cairo diff --git a/src/numeric/src/tests/integers_test.cairo b/packages/numeric/src/tests/integers_test.cairo similarity index 100% rename from src/numeric/src/tests/integers_test.cairo rename to packages/numeric/src/tests/integers_test.cairo diff --git a/src/numeric/src/tests/interpolate_fast_test.cairo b/packages/numeric/src/tests/interpolate_fast_test.cairo similarity index 100% rename from src/numeric/src/tests/interpolate_fast_test.cairo rename to packages/numeric/src/tests/interpolate_fast_test.cairo diff --git a/src/numeric/src/tests/interpolate_test.cairo b/packages/numeric/src/tests/interpolate_test.cairo similarity index 100% rename from src/numeric/src/tests/interpolate_test.cairo rename to packages/numeric/src/tests/interpolate_test.cairo diff --git a/src/numeric/src/tests/trapezoidal_rule_test.cairo b/packages/numeric/src/tests/trapezoidal_rule_test.cairo similarity index 100% rename from src/numeric/src/tests/trapezoidal_rule_test.cairo rename to packages/numeric/src/tests/trapezoidal_rule_test.cairo diff --git a/src/numeric/src/trapezoidal_rule.cairo b/packages/numeric/src/trapezoidal_rule.cairo similarity index 100% rename from src/numeric/src/trapezoidal_rule.cairo rename to packages/numeric/src/trapezoidal_rule.cairo diff --git a/src/searching/README.md b/packages/searching/README.md similarity index 89% rename from src/searching/README.md rename to packages/searching/README.md index 6b5f05c3..559a6851 100644 --- a/src/searching/README.md +++ b/packages/searching/README.md @@ -1,19 +1,19 @@ # Searching -## [Boyer-Moore algorithm](./src/bm_search.cairo) +## [Boyer-Moore algorithm](./packages/bm_search.cairo) The Boyer-Moore algorithm is a string-searching algorithm that finds the position of a pattern in a string. It preprocesses the pattern to create two lookup tables: one for the bad character rule and one for the good suffix rule. The bad character rule shifts the pattern to align with the last occurrence of the mismatched character in the pattern. The good suffix rule shifts the pattern to align with the last occurrence of the suffix of the pattern that matches the suffix of the text. The Boyer-Moore algorithm has a best-case time complexity of O(n/m) and a worst-case time complexity of O(nm), where n is the length of the text and m is the length of the pattern. It is the most efficient string-searching algorithm in practice. -## [Binary search](./src/binary_search.cairo) +## [Binary search](./packages/binary_search.cairo) The binary search algorithm is a simple search in an ordered array-like compound. It starts by comparing the value we are looking for to the middle of the array. If it's not a match, the function calls itself recursively on the right or left half of the array until it does(n't) find the value in the array. -## [Dijkstra](./src/dijkstra.cairo) +## [Dijkstra](./packages/dijkstra.cairo) Dijkstra's algorithm is a graph search algorithm that finds the shortest path from a source node to all other nodes in a weighted graph, ensuring the shortest distances are progressively updated as it explores nodes. It maintains a priority queue of nodes based on their tentative distances from the source and greedily selects the node with the smallest distance at each step. -## [Levenshtein distance](./src/levenshtein_distance.cairo) +## [Levenshtein distance](./packages/levenshtein_distance.cairo) The Levenshtein distance is a string metric for measuring the difference between two sequences. It is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. This version of the algorithm optmizes the space complexity. Time complexity: O(nm). Space complexity: O(n), diff --git a/src/searching/Scarb.toml b/packages/searching/Scarb.toml similarity index 93% rename from src/searching/Scarb.toml rename to packages/searching/Scarb.toml index 44d1ffe5..79bceaae 100644 --- a/src/searching/Scarb.toml +++ b/packages/searching/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_searching" version = "0.1.0" description = "A set of searching algorithms" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/src/searching" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/searching" edition = "2023_11" [tool] diff --git a/src/searching/src/binary_search.cairo b/packages/searching/src/binary_search.cairo similarity index 100% rename from src/searching/src/binary_search.cairo rename to packages/searching/src/binary_search.cairo diff --git a/src/searching/src/bm_search.cairo b/packages/searching/src/bm_search.cairo similarity index 100% rename from src/searching/src/bm_search.cairo rename to packages/searching/src/bm_search.cairo diff --git a/src/searching/src/dijkstra.cairo b/packages/searching/src/dijkstra.cairo similarity index 100% rename from src/searching/src/dijkstra.cairo rename to packages/searching/src/dijkstra.cairo diff --git a/src/searching/src/levenshtein_distance.cairo b/packages/searching/src/levenshtein_distance.cairo similarity index 100% rename from src/searching/src/levenshtein_distance.cairo rename to packages/searching/src/levenshtein_distance.cairo diff --git a/src/searching/src/lib.cairo b/packages/searching/src/lib.cairo similarity index 100% rename from src/searching/src/lib.cairo rename to packages/searching/src/lib.cairo diff --git a/src/searching/src/tests.cairo b/packages/searching/src/tests.cairo similarity index 100% rename from src/searching/src/tests.cairo rename to packages/searching/src/tests.cairo diff --git a/src/searching/src/tests/binary_search_closest_test.cairo b/packages/searching/src/tests/binary_search_closest_test.cairo similarity index 100% rename from src/searching/src/tests/binary_search_closest_test.cairo rename to packages/searching/src/tests/binary_search_closest_test.cairo diff --git a/src/searching/src/tests/binary_search_test.cairo b/packages/searching/src/tests/binary_search_test.cairo similarity index 100% rename from src/searching/src/tests/binary_search_test.cairo rename to packages/searching/src/tests/binary_search_test.cairo diff --git a/src/searching/src/tests/bm_search_test.cairo b/packages/searching/src/tests/bm_search_test.cairo similarity index 100% rename from src/searching/src/tests/bm_search_test.cairo rename to packages/searching/src/tests/bm_search_test.cairo diff --git a/src/searching/src/tests/dijkstra_test.cairo b/packages/searching/src/tests/dijkstra_test.cairo similarity index 100% rename from src/searching/src/tests/dijkstra_test.cairo rename to packages/searching/src/tests/dijkstra_test.cairo diff --git a/src/searching/src/tests/levenshtein_distance_test.cairo b/packages/searching/src/tests/levenshtein_distance_test.cairo similarity index 100% rename from src/searching/src/tests/levenshtein_distance_test.cairo rename to packages/searching/src/tests/levenshtein_distance_test.cairo diff --git a/src/sorting/README.md b/packages/sorting/README.md similarity index 95% rename from src/sorting/README.md rename to packages/sorting/README.md index 39edf573..bdec4754 100644 --- a/src/sorting/README.md +++ b/packages/sorting/README.md @@ -1,6 +1,6 @@ # Sorting -## [Quick Sort](./src/quick_sort.cairo) +## [Quick Sort](./packages/quick_sort.cairo) The Quick Sort algorithm is an efficient sorting algorithm used to sort a list of elements. It operates by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. The sub-arrays are then recursively sorted. @@ -11,7 +11,7 @@ The space complexity of the algorithm is O(log n) due to the stack space require The Quick Sort algorithm is considered one of the more efficient sorting algorithms, especially for larger lists. Its efficiency and low space complexity make it a popular choice for many sorting tasks, despite the potential for a high time complexity in the worst-case scenario. -## [Bubble Sort](./src/bubble_sort.cairo) +## [Bubble Sort](./packages/bubble_sort.cairo) The bubble sort algorithm is a simple sorting algorithm used to sort a list of elements by repeatedly swapping adjacent elements if they are in the wrong order until the list is sorted. The purpose of the bubble sort algorithm is to provide a basic and intuitive sorting method that is easy to understand and implement. While the algorithm has a time complexity of O(n^2), which can make it inefficient for large lists, it is useful for smaller lists and can serve as a starting point for more complex sorting algorithms. @@ -21,7 +21,7 @@ The space complexity of the algorithm is O(1). The bubble sort algorithm is considered one of the least efficient sorting algorithms, especially for larger lists, as its time complexity makes it impractical for large datasets. However, it is still useful in some specific situations where memory usage is a concern. -## [Merge Sort](./src/merge_sort.cairo) +## [Merge Sort](./packages/merge_sort.cairo) The merge sort algorithm is a sorting algorithm used to sort a list of elements by dividing it into smaller sub-lists, sorting those sub-lists, and then merging them back together. The purpose of the merge sort algorithm is to provide a way to efficiently sort large amounts of data. The algorithm has applications in various areas of computer science and data analysis, including database management, information retrieval, and machine learning. diff --git a/src/sorting/Scarb.toml b/packages/sorting/Scarb.toml similarity index 92% rename from src/sorting/Scarb.toml rename to packages/sorting/Scarb.toml index 5a1ab819..c5341ac4 100644 --- a/src/sorting/Scarb.toml +++ b/packages/sorting/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_sorting" version = "0.1.0" description = "A set of sorting algorithms" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/src/sorting" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/sorting" edition = "2023_11" [tool] diff --git a/src/sorting/src/bubble_sort.cairo b/packages/sorting/src/bubble_sort.cairo similarity index 100% rename from src/sorting/src/bubble_sort.cairo rename to packages/sorting/src/bubble_sort.cairo diff --git a/src/sorting/src/interface.cairo b/packages/sorting/src/interface.cairo similarity index 100% rename from src/sorting/src/interface.cairo rename to packages/sorting/src/interface.cairo diff --git a/src/sorting/src/lib.cairo b/packages/sorting/src/lib.cairo similarity index 100% rename from src/sorting/src/lib.cairo rename to packages/sorting/src/lib.cairo diff --git a/src/sorting/src/merge_sort.cairo b/packages/sorting/src/merge_sort.cairo similarity index 100% rename from src/sorting/src/merge_sort.cairo rename to packages/sorting/src/merge_sort.cairo diff --git a/src/sorting/src/quick_sort.cairo b/packages/sorting/src/quick_sort.cairo similarity index 100% rename from src/sorting/src/quick_sort.cairo rename to packages/sorting/src/quick_sort.cairo diff --git a/src/sorting/src/tests.cairo b/packages/sorting/src/tests.cairo similarity index 100% rename from src/sorting/src/tests.cairo rename to packages/sorting/src/tests.cairo diff --git a/src/sorting/src/tests/bubble_sort_test.cairo b/packages/sorting/src/tests/bubble_sort_test.cairo similarity index 100% rename from src/sorting/src/tests/bubble_sort_test.cairo rename to packages/sorting/src/tests/bubble_sort_test.cairo diff --git a/src/sorting/src/tests/merge_sort_test.cairo b/packages/sorting/src/tests/merge_sort_test.cairo similarity index 100% rename from src/sorting/src/tests/merge_sort_test.cairo rename to packages/sorting/src/tests/merge_sort_test.cairo diff --git a/src/sorting/src/tests/quick_sort_test.cairo b/packages/sorting/src/tests/quick_sort_test.cairo similarity index 100% rename from src/sorting/src/tests/quick_sort_test.cairo rename to packages/sorting/src/tests/quick_sort_test.cairo diff --git a/src/storage/README.md b/packages/storage/README.md similarity index 100% rename from src/storage/README.md rename to packages/storage/README.md diff --git a/src/storage/Scarb.toml b/packages/storage/Scarb.toml similarity index 91% rename from src/storage/Scarb.toml rename to packages/storage/Scarb.toml index e483c83d..052aad35 100644 --- a/src/storage/Scarb.toml +++ b/packages/storage/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_storage" version = "0.3.0" description = "Starknet storage utilities" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/src/storage" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/storage" edition = "2023_11" [tool] diff --git a/src/storage/src/lib.cairo b/packages/storage/src/lib.cairo similarity index 100% rename from src/storage/src/lib.cairo rename to packages/storage/src/lib.cairo diff --git a/src/storage/src/list.cairo b/packages/storage/src/list.cairo similarity index 100% rename from src/storage/src/list.cairo rename to packages/storage/src/list.cairo diff --git a/src/storage/src/tests.cairo b/packages/storage/src/tests.cairo similarity index 100% rename from src/storage/src/tests.cairo rename to packages/storage/src/tests.cairo diff --git a/src/storage/src/tests/list_test.cairo b/packages/storage/src/tests/list_test.cairo similarity index 100% rename from src/storage/src/tests/list_test.cairo rename to packages/storage/src/tests/list_test.cairo diff --git a/src/utils/README.md b/packages/utils/README.md similarity index 100% rename from src/utils/README.md rename to packages/utils/README.md diff --git a/src/utils/Scarb.toml b/packages/utils/Scarb.toml similarity index 91% rename from src/utils/Scarb.toml rename to packages/utils/Scarb.toml index 12196633..13dddd6c 100644 --- a/src/utils/Scarb.toml +++ b/packages/utils/Scarb.toml @@ -2,7 +2,7 @@ name = "alexandria_utils" version = "0.1.0" description = "Cairo utilities" -homepage = "https://github.com/keep-starknet-strange/alexandria/tree/src/utils" +homepage = "https://github.com/keep-starknet-strange/alexandria/tree/main/src/utils" edition = "2023_11" [tool] diff --git a/src/utils/src/fmt.cairo b/packages/utils/src/fmt.cairo similarity index 100% rename from src/utils/src/fmt.cairo rename to packages/utils/src/fmt.cairo diff --git a/src/utils/src/lib.cairo b/packages/utils/src/lib.cairo similarity index 100% rename from src/utils/src/lib.cairo rename to packages/utils/src/lib.cairo