https://discord.cloudflare.com logo
Join DiscordCommunities
Powered by
# workers-discussions
  • w

    Walshy | Pages

    03/19/2023, 6:10 PM
    So no, no support for them.
  • d

    Dogs

    03/19/2023, 6:10 PM
    ahhh yeah i forgot about taht
  • n

    nikitasius

    03/19/2023, 8:38 PM
    there are strange issue with
    crypto.getRandomValues()
    .
    Copy code
    const arrayBytes = new Uint8Array(8);
            crypto.getRandomValues(arrayBytes);
            console.log(btoa(arrayBytes));
    i wanna 8 random bytes.
    OTYsMjExLDE2LDE3OCw0MSw5NSw3OCwzMg==
    -> 25 bytes
    39 36 2c 32 31 31 2c 31 36 2c 31 37 38 2c 34 31 2c 39 35 2c 37 38 2c 33 32
    MTM0LDE0LDI1MCwyMDksMjQ5LDIxNiwxNTMsMTQx
    -> 30 bytes
    31 33 34 2c 31 34 2c 32 35 30 2c 32 30 39 2c 32 34 39 2c 32 31 36 2c 31 35 33 2c 31 34 31
    MjA3LDcwLDE0OSwzNSwyMzMsMTQ5LDY4LDE0OA==
    -> 28 bytes
    32 30 37 2c 37 30 2c 31 34 39 2c 33 35 2c 32 33 33 2c 31 34 39 2c 36 38 2c 31 34 38
  • n

    nikitasius

    03/19/2023, 8:39 PM
    P.S. i'm not a TS dev, but why when i'm asking 8 bytes into the array, i have more?
  • d

    Dani Foldi

    03/19/2023, 8:50 PM
    btoa
    decodes base64 values. If you want to print the random bytes, you can use the
    toString
    method, or simply
    console.log(arrayBytes)
    , which gave me > {"0": 99, "1": 95, "2": 88, "3": 45, "4": 87, "5": 217, "6": 127, "7": 71} for example
  • n

    nikitasius

    03/19/2023, 8:51 PM
    btoa encodes regarding the google
  • n

    nikitasius

    03/19/2023, 8:51 PM
    i need to get correct base64 from that byte array. btw
    console.log(arrayBytes.length);
    return 8.
  • d

    Dani Foldi

    03/19/2023, 8:51 PM
    that's also possible, 50% chance 😅
  • n

    nikitasius

    03/19/2023, 8:52 PM
    i did not get the point
  • n

    nikitasius

    03/19/2023, 8:53 PM
    i generate 8 random bytes, next i convert them into base64. Thats RFC stuff, so there are strict specs.
  • n

    nikitasius

    03/19/2023, 8:53 PM
    when i decode base64 i see more than 8 bytes,
  • d

    Dani Foldi

    03/19/2023, 8:53 PM
    if you check what you have encoded, you're encoding the string
    207,70,149,35,233,149,68,148
    in one of your example cases.
  • d

    Dani Foldi

    03/19/2023, 8:54 PM
    btoa and atob accept strings, and coerce others into strings
  • n

    nikitasius

    03/19/2023, 8:54 PM
    hmm.. well, need to find how to tell to btoa "use that byte array as a byte array", oke, i think i got the point
  • d

    Dani Foldi

    03/19/2023, 8:56 PM
    oh, so that's what you're looking for. I'd do something like
    btoa([...arrayBytes].map(String.fromCodePoint).join(''))
    - spread into regular array so array ops work - map to strings from code point, basically convert to string value - base64
  • n

    nikitasius

    03/19/2023, 9:00 PM
    Thanks, i will take a look tomorrow. Thats why i love classic Base64 from Java
  • r

    renzor

    03/19/2023, 10:30 PM
    hi, is there a way to make a scheduled worker deploy to a specific region?
  • s

    samon

    03/20/2023, 12:16 AM
    https://discord.com/channels/595317990191398933/1087111598130348223
  • s

    samon

    03/20/2023, 12:16 AM
    can someone take a look plz
  • c

    Chaika

    03/20/2023, 12:44 AM
    You're talking about CRON Triggers? The most you can influence their direct placement is if you have Green Compute or Global Compute set. Otherrwise, you can use Durable Objects created in specific regions via locationHints, but depending on what you are doing, that could be expensive
  • s

    Srd

    03/20/2023, 1:58 AM
    Anyone got an example for github deployment workflow with a turborepo monorepo?
  • z

    zizi

    03/20/2023, 5:21 AM
    is there any possible worker can support http request streaming? Seems worker buffer http request until request body is ready. https://developer.chrome.com/articles/fetch-streaming-requests/
  • m

    Mass

    03/20/2023, 7:33 AM
    Hi, I am trying to perfom a fetch call from a worker to an external api. My worker is on
    app.coderpunk.dev
    and I am trying to call
    login.coderpunk.dev/.well-known/jwks.json
    .
    login
    is a cname that maps to an external api. If I call
    login.coderpunk.dev/.well-known/jwks.json
    with a curl in my terminal I get the response, however when I call that from the worker it looks like the request never fires. Has anyone successfully done anything similar before that can help me with this?
  • g

    gunnars04

    03/20/2023, 8:17 AM
    hi, if you use cloudflared to connect to a k8s cluster, could you use CF Workers to call it? https://developers.cloudflare.com/cloudflare-one/tutorials/many-cfd-one-tunnel/
  • h

    HardAtWork

    03/20/2023, 8:42 AM
    Yes
  • a

    Am1nCmd

    03/20/2023, 10:20 AM
    hi everyone, is there any way to pause cloudflare workers temporary?
  • h

    HardAtWork

    03/20/2023, 10:21 AM
    Disable all routes/crons?
  • a

    Am1nCmd

    03/20/2023, 10:22 AM
    where I can find that? I didn't see it on cloudflare workers dashboard
  • a

    Am1nCmd

    03/20/2023, 10:24 AM
    ah I found it
  • g

    gunnars04

    03/20/2023, 11:22 AM
    Hi, do I understand it right that in CF Workers, I can fine grain control my cache/headers/etc. and cache dynamic content to achieve up to 99% cache vs. using "standard" CF cache that only can only cache static content (that doesn't change)?
1...234823492350...2509Latest