Unified Foundation Library for Eiffel Projects
simple_foundation_api is a unified facade that bundles essential foundation libraries for any Eiffel project. Instead of managing multiple library dependencies, use a single FOUNDATION_API class that provides access to encoding, hashing, UUID generation, JSON handling, CSV processing, markdown conversion, validation, and more.
- Base64 - Standard and URL-safe Base64 encoding/decoding
- Hashing - SHA-256, SHA-1, MD5, and HMAC-SHA256 algorithms
- UUID - Generate v4 UUIDs in standard and compact formats
- JSON - Parse, validate, and build JSON with JSONPath queries
- CSV - Parse and generate CSV data with header support
- Markdown - Convert Markdown to HTML with table of contents
- Validation - Fluent data validation with chainable rules
- Process - Execute shell commands and capture output
- Random - Generate random integers, strings, words, and UUIDs
This library bundles the following simple_* libraries:
| Library | Purpose | Environment Variable |
|---|---|---|
| simple_base64 | Base64 encoding/decoding | $SIMPLE_BASE64 |
| simple_hash | Cryptographic hashing | $SIMPLE_HASH |
| simple_uuid | UUID generation | $SIMPLE_UUID |
| simple_json | JSON parsing/building | $SIMPLE_JSON |
| simple_csv | CSV processing | $SIMPLE_CSV |
| simple_markdown | Markdown conversion | $SIMPLE_MARKDOWN |
| simple_validation | Data validation | $SIMPLE_VALIDATION |
| simple_process | Process execution | $SIMPLE_PROCESS |
| simple_randomizer | Random generation | $SIMPLE_RANDOMIZER |
- Clone all required repositories
- Set environment variables for each library
- Add to your ECF:
<library name="simple_foundation_api"
location="$SIMPLE_FOUNDATION_API\simple_foundation_api.ecf"/>local
api: FOUNDATION_API
do
create api.make
-- Base64 encoding
api.base64_encode ("Hello") -- "SGVsbG8="
-- SHA-256 hashing
api.sha256 ("data")
-- UUID generation
api.new_uuid -- "550e8400-e29b-41d4-a716-446655440000"
-- JSON parsing
if attached api.parse_json ("{%"name%": %"test%"}") as json then
...
end
-- Markdown conversion
api.markdown_to_html ("# Hello World")
-- Validation
if api.is_valid_email ("test@example.com") then
...
end
-- Random generation
api.random_integer_in_range (1, 100)
endbase64_encode,base64_decodebase64_url_encode,base64_url_decodebase64_encode_bytes- Encode byte arrays (for binary data)
sha256,sha256_bytessha1,sha1_bytesmd5,md5_byteshmac_sha256,hmac_sha256_bytessecure_compare- Constant-time string comparison (timing-attack safe)
new_uuid,new_uuid_compactis_valid_uuid
parse_json,is_valid_jsonnew_json_object,new_json_arrayjson_has_errors,json_errors
parse_csv,parse_csv_with_headercsv_field,csv_row_count,csv_column_countcsv_to_string
markdown_to_html,markdown_to_html_fragmentmarkdown_table_of_contents
new_validatoris_valid_email,is_valid_url
random_integer,random_integer_in_rangerandom_real,random_booleanrandom_word,random_sentencerandom_alphanumeric_string
bytes_to_hex,hex_to_bytesexecute_command,has_file_in_path
For advanced operations, access underlying libraries directly:
json- SIMPLE_JSONcsv- SIMPLE_CSVmarkdown- SIMPLE_MARKDOWNprocess- SIMPLE_PROCESS_HELPERrandom- SIMPLE_RANDOMIZER
MIT License - see LICENSE file for details.
Larry Rix
