https://supabase.com/ logo
Join Discord
Powered by
# off-topic
  • u

    <hmmhmmhm/>

    05/21/2023, 3:14 AM
    I'm just fixing to remove plv8ify and just swc build it.
  • u

    <hmmhmmhm/>

    05/21/2023, 3:30 AM

    https://cdn.discordapp.com/attachments/839993398554656831/1109684700886343690/image.png▾

  • u

    <hmmhmmhm/>

    05/21/2023, 3:32 AM
    What if I wrapped PLV8 and meant for typescript support, would it be better to add some more utility functions?
  • c

    Crembo

    05/21/2023, 12:52 PM
    has anyone come up with a definitive answer to "if you want to obfuscate IDs so they're unpredictable, just do THIS"? I've been googling for the past week and sank into despair with all the vague or inapplicable answers despite it appearing to be a 100% solved problem
  • r

    Razoth

    05/21/2023, 12:54 PM
    use UID`s
  • c

    Crembo

    05/21/2023, 12:55 PM
    I should've qualified: short. like, 5-10 alphanumeric characters
  • r

    Razoth

    05/21/2023, 12:55 PM
    use short UID's 😛
  • c

    Crembo

    05/21/2023, 12:56 PM
    buh?
  • r

    Razoth

    05/21/2023, 1:00 PM
    there are methods to shorten them, but may i ask why you need them to be shorter?
  • c

    Crembo

    05/21/2023, 1:01 PM
    "pretty is a feature". the URL needs to - and I'm quoting here - "not be lame", which means a shortish alphanumeric string. a-la youtube, imgur et al
  • r

    Razoth

    05/21/2023, 1:06 PM
    can't you use something other than UID then? ive seen sites use random names for links.
  • r

    Razoth

    05/21/2023, 1:07 PM
    you can use something based on unix time to generate a random unique string ala youtube
  • c

    Crembo

    05/21/2023, 1:07 PM
    there's a bunch of ways. pg_hashids would be perfect.. if it weren't for the very dire warnings against expecting it to make "hard to guess" URLs, since it's cryptographically broke
  • r

    Razoth

    05/21/2023, 1:07 PM
    dunno how secure and "obfuscated" it has to be tho
  • c

    Crembo

    05/21/2023, 1:07 PM
    there IS the option of generating various random strings and storing them as an added column, but ughh the disk space and indexing costs..
  • r

    Razoth

    05/21/2023, 1:09 PM
    well, tell your boss (i assume) then, either "pretty as a feature" and gimme the right resources to implement it, or deal with something not pretty... i know what its like to have to deal with something like this, but i don't think there is a good way to do this while still keeping resource usage to a minimum
  • c

    Crembo

    05/21/2023, 1:11 PM
    the main thing is - again, I KNOW this has to be a solved problem because of how many sites do it and do it well, but there's no "this is the way" definitive guide, which is weird considering how frequently the "I need to generate a short alphanumeric unpredictable URL for my resources" problem has come up in all of programming
  • r

    Razoth

    05/21/2023, 1:12 PM
    the unique string based on unix time is not feasable?
  • r

    Razoth

    05/21/2023, 1:13 PM
    ive found https://github.com/vinkla/hashids
  • c

    Crembo

    05/21/2023, 1:13 PM
    yes, that library is perfect except - if you read further down the page - there are dire warnings that it is cryptographically broken and does not count as unpredictable
  • c

    Crembo

    05/21/2023, 1:13 PM
    there's a variety of reasons why you don't want a visitor to be able to guess URLs, or take a URL and guess a sequential ID from it
  • r

    Razoth

    05/21/2023, 1:14 PM
    can't you just use uid's on the backend?
  • a better option might be nanoid like
    c

    Crembo

    05/21/2023, 1:14 PM
    a better option might be nanoid, like this one https://github.com/viascom/nanoid-postgres/blob/main/nanoid.sql
    r
    • 2
    • 46
  • r

    Razoth

    05/21/2023, 1:14 PM
    and convert them on the frontend?
  • r

    Razoth

    05/21/2023, 1:15 PM
    (we should probably have created a thread, since we are spamming the offtopic channel hard)
  • u

    <hmmhmmhm/>

    05/21/2023, 1:57 PM

    https://cdn.discordapp.com/attachments/839993398554656831/1109842496474841178/image.png▾

  • u

    <hmmhmmhm/>

    05/21/2023, 1:58 PM
    I'm on a speedrun in the middle of the night
  • j

    JayTheKing

    05/22/2023, 7:13 AM
    I looked and didn't see the warning about being cryptographically broken? There honestly nothing wrong with using this if stuff like KSUID, XID etc are not available.
  • c

    cyberpunq

    05/22/2023, 1:13 PM
    legend
  • c

    ChocooPanda

    05/22/2023, 6:25 PM
    Hey ! I'm glad I found this Discord, I hope I'll find the help I need to unlock my issue 🙂
1...388389390391392Latest