Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hoodmane/workers-md5-example
Example cloudflare worker based on an Emscripten build of md5
https://github.com/hoodmane/workers-md5-example
Last synced: about 2 months ago
JSON representation
Example cloudflare worker based on an Emscripten build of md5
- Host: GitHub
- URL: https://github.com/hoodmane/workers-md5-example
- Owner: hoodmane
- Created: 2024-08-05T20:46:45.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-05T20:55:46.000Z (5 months ago)
- Last Synced: 2024-10-31T20:52:34.286Z (2 months ago)
- Language: C
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Emscripten md5 cloudflare worker example
This example makes a cloudflare worker that accepts POST requests, md5 sums the
body, and returns the result as a hex string. When running it,
```sh
curl http://localhost:8787/ -d 'some_data'
```
returns the same md5 sum as:
```sh
printf 'some_data' | md5sum -
```## To build
1. Install Emscripten (I used 3.1.58 but any reasonably recent one should work)
and ensure that emcc is on the path. E.g.,
```sh
git clone https://github.com/emscripten-core/emsdk.git./emsdk/emsdk install 3.1.58
./emsdk/emsdk activate 3.1.58
source ./emsdk/emsdk_env.sh
```2. Run `make`.
## To test
First build and then run `npx wrangler dev src/main.js`.