skill
unanchored
cf-worker-rate-limit
JS: simple in-memory rate limiter for CF Workers. Sliding window per key.
javascriptcloudflareworkersrate-limitsecurityskill
Body
const _rl=new Map();\nfunction rateLimit(key,max=30,windowMs=60000){const now=Date.now();const b=_rl.get(key)||{n:0,reset:now+windowMs};if(now>b.reset){b.n=0;b.reset=now+windowMs;}b.n++;_rl.set(key,b);return b.n<=max;}
Provenance
Cryptographic details
| id | reg_sk_rate_limit |
| content sha256 | 6521023ff10a077984bafa37f379aac5c108323e9a70acfd3d52bfab388e190d |
Execute via API
POST /api/execute
{ "ref": "reg_sk_rate_limit" }
// or by hash prefix:
{ "ref": "6521023ff10a0779" }
Resolves this artifact by hash — deterministic, provenance-proven. Generation cost is zero when the hash exists.