{"id":18098485,"url":"https://github.com/danieloneill/quickjs-wolfssl","last_synced_at":"2025-06-19T21:33:02.077Z","repository":{"id":164323242,"uuid":"639766720","full_name":"danieloneill/quickjs-wolfssl","owner":"danieloneill","description":"Simple base64 encoding and md5/sha256 hashing module for QuickJS using WolfSSL","archived":false,"fork":false,"pushed_at":"2023-12-19T22:18:59.000Z","size":855,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T04:17:52.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danieloneill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-12T07:18:51.000Z","updated_at":"2024-07-30T09:53:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc0042c0-7516-42b6-8667-75cc64c474ee","html_url":"https://github.com/danieloneill/quickjs-wolfssl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danieloneill/quickjs-wolfssl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-wolfssl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-wolfssl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-wolfssl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-wolfssl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danieloneill","download_url":"https://codeload.github.com/danieloneill/quickjs-wolfssl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-wolfssl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260835241,"owners_count":23070256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T20:11:26.622Z","updated_at":"2025-06-19T21:32:57.067Z","avatar_url":"https://github.com/danieloneill.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quickjs-wolfssl\nSimple base64 encoding and md5/sha256 hashing module for QuickJS using WolfSSL\n\nBuilding requires editing the Makefile and pointing it to your quickjs-2023-12-09 directory, and having WolfSSL installed (with headers).\n\nWolfSSL doesn't build with Base64 encoding support on ARM by default, so in my case (aarch64) I had to build WolfSSL with it explicitly enabled.\n\nSee **example.js** for usage.\n\nConsists of only a few methods:\n- toBase64\n- fromBase64\n- md5sum\n- sha256sum\n- uint8ArrayToString\n- stringToUint8Array\n- tlsServer - which provides\n  - wrap(fd) - which provides:\n    - read\n    - write\n    - accept\n    - shutdown\n\nEach method accepts one parameter.\n\n*toBase64*, *md5sum*, and *sha256sum* expect a Uint8Array as the only parameter.\n\n*toBase64* returns a string containing the Base64 encoded data.\n\n*md5sum* and *sha256sum* return a hex-encoded string representing the calculated hash of the contents passed.\n\n*fromBase64* expects a string as the only parameter and returns a Uint8Array (actually, a Uint32Array but whatever.)\n\n*uint8ArrayToString* accepts a UInt8Array and returns it as a string. *stringToUint8Array* does the opposite. They both only accept one arg, and you can probably guess what arg it is.\n\n*tlsServer* expects a path to your certificate and a path to your private key, and returns a new TLS server object which just has the 'wrap' method.\n\n*wrap* accepts a file descriptor and returns a super-saiyan version of it as a TLS client sorta. I say 'sorta' because the new object only has 4 methods, since you can use standard os.* and net.* methods on the original socket as usual for other purposes, but you will need new read, wrote, accept, and shutdown methods when working with TLS.\n\n*read(maxlen)* returns a UInt8Array of received bytes or throws on error.\n\n*write(data)* writes the provided UInt8Array to the client, or throws on error. Returns true too, for some reason.\n\n*accept* only makes sense on a new client (that was just wrapped) and needs to be called to do the post-vanilla-accept handshaking and negociations.\n\n*shutdown* shuts down the socket.\n\nFeature requests and PRs are welcome. Also check out my [low-level sockets module](https://github.com/danieloneill/quickjs-net) or my [OpenSSL-based hash module](https://github.com/danieloneill/quickjs-hash).\n\n--\n\nTo use the httpserver.js example, your files go into webroot/ and you also need to copy/link the net.so result from the low-level sockets module above to the same dir as the script. It doesn't do much, but it does offer dir listings.\n\nI shouldn't have to say this, but httpserver.js isn't intended for any production purposes: it's just a toy I threw in for testing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieloneill%2Fquickjs-wolfssl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieloneill%2Fquickjs-wolfssl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieloneill%2Fquickjs-wolfssl/lists"}