feat: add example scripts for argparse, bytes, dataset, html, markdown, uuid, wdantic, and web chat modules
Add comprehensive demo scripts showcasing the usage of multiple Wren modules including argument parsing, byte manipulation, in-memory dataset operations, HTML encoding/slugification, markdown-to-HTML conversion, UUID generation/validation, schema validation with wdantic, and a full web chat application with REST endpoints.
2026-01-24 23:40:22 +01:00
|
|
|
// Please do not edit this file. It has been generated automatically
|
|
|
|
|
// from `src/module/uuid.wren` using `util/wren_to_c_string.py`
|
|
|
|
|
|
|
|
|
|
static const char* uuidModuleSource =
|
|
|
|
|
"// retoor <retoor@molodetz.nl>\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"import \"crypto\" for Crypto\n"
|
feat: add merge_all_wren utility, strutil demo, and 7 new API manual pages
Add WrenFileReader class in apps/merge_all_wren.wren for recursive .wren file discovery and content printing. Introduce example/strutil_demo.wren demonstrating case conversion, hex encoding, SHA256 hashing, string repetition, padding, HTML/JSON escaping, and URL encoding/decoding. Create manual/api pages for argparse, dataset, html, markdown, uuid, wdantic, and web modules. Update manual/api/index.html sidebar and module count from 21 to 28, adding links and cards for the new modules.
2026-01-25 02:47:47 +01:00
|
|
|
"import \"strutil\" for Str\n"
|
|
|
|
|
"import \"bytes\" for Bytes\n"
|
feat: add example scripts for argparse, bytes, dataset, html, markdown, uuid, wdantic, and web chat modules
Add comprehensive demo scripts showcasing the usage of multiple Wren modules including argument parsing, byte manipulation, in-memory dataset operations, HTML encoding/slugification, markdown-to-HTML conversion, UUID generation/validation, schema validation with wdantic, and a full web chat application with REST endpoints.
2026-01-24 23:40:22 +01:00
|
|
|
"\n"
|
|
|
|
|
"class Uuid {\n"
|
feat: add merge_all_wren utility, strutil demo, and 7 new API manual pages
Add WrenFileReader class in apps/merge_all_wren.wren for recursive .wren file discovery and content printing. Introduce example/strutil_demo.wren demonstrating case conversion, hex encoding, SHA256 hashing, string repetition, padding, HTML/JSON escaping, and URL encoding/decoding. Create manual/api pages for argparse, dataset, html, markdown, uuid, wdantic, and web modules. Update manual/api/index.html sidebar and module count from 21 to 28, adding links and cards for the new modules.
2026-01-25 02:47:47 +01:00
|
|
|
" static toHex_(bytes) { Str.hexEncode(Bytes.fromList(bytes)) }\n"
|
feat: add example scripts for argparse, bytes, dataset, html, markdown, uuid, wdantic, and web chat modules
Add comprehensive demo scripts showcasing the usage of multiple Wren modules including argument parsing, byte manipulation, in-memory dataset operations, HTML encoding/slugification, markdown-to-HTML conversion, UUID generation/validation, schema validation with wdantic, and a full web chat application with REST endpoints.
2026-01-24 23:40:22 +01:00
|
|
|
"\n"
|
|
|
|
|
" static v4() {\n"
|
|
|
|
|
" var bytes = Crypto.randomBytes(16)\n"
|
|
|
|
|
" bytes[6] = (bytes[6] & 0x0F) | 0x40\n"
|
|
|
|
|
" bytes[8] = (bytes[8] & 0x3F) | 0x80\n"
|
|
|
|
|
" var hex = toHex_(bytes)\n"
|
|
|
|
|
" return hex[0..7] + \"-\" + hex[8..11] + \"-\" + hex[12..15] + \"-\" + hex[16..19] + \"-\" + hex[20..31]\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
"\n"
|
|
|
|
|
" static isValid(string) {\n"
|
|
|
|
|
" if (!(string is String)) return false\n"
|
|
|
|
|
" if (string.count != 36) return false\n"
|
|
|
|
|
" if (string[8] != \"-\" || string[13] != \"-\" || string[18] != \"-\" || string[23] != \"-\") return false\n"
|
|
|
|
|
" var hexChars = \"0123456789abcdefABCDEF\"\n"
|
|
|
|
|
" var positions = [0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]\n"
|
|
|
|
|
" for (pos in positions) {\n"
|
|
|
|
|
" if (!hexChars.contains(string[pos])) return false\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
" return true\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
"\n"
|
|
|
|
|
" static isV4(string) {\n"
|
|
|
|
|
" if (!isValid(string)) return false\n"
|
|
|
|
|
" var version = string[14]\n"
|
|
|
|
|
" if (version != \"4\") return false\n"
|
|
|
|
|
" var variant = string[19]\n"
|
|
|
|
|
" if (variant != \"8\" && variant != \"9\" && variant != \"a\" && variant != \"b\" && variant != \"A\" && variant != \"B\") return false\n"
|
|
|
|
|
" return true\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
"}\n";
|