Just take the string as bytes and hash it ffs

  • Björn Tantau@swg-empire.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Take a string as bytes is bad with weird non-ASCII characters. Been there, been bitten in the ass by it.

    At least with e-mail clients different clients on different operating systems use different encoding by default for their passwords.

    With a router I could imagine different client apps following different standards.

    • expr@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      You don’t have to take arbitrary bytes. UTF-8 encoded strings are just fine and easily handled by libraries.

      • Björn Tantau@swg-empire.de
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        At least with e-mail clients different clients on different operating systems use different encoding by default for their passwords.