The sha1 hash for 64test64xa is 6779c53432b8badf049bb9d8924a5785dd887243 which is 41 characters only using hexadecimal, 10digits and 6letters. But how long it would be if it was using the whole 26 letters in the latin alphabet? What if it also differentiated between UPPER and lower cases?

  • Melody Fwygon@lemmy.one
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Yeah you can always take a hex hash output and convert it to Base64…which does conpress it significantly. Apply LZ Compression and boom.

    • tunetardis@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      Apply LZ Compression and boom.

      That would produce a binary stream. If that’s what OP wants, they could just leave the original hash in binary. And that would be unlikely to compress any further since hashes are, by their nature, high entropy already.

      • Melody Fwygon@lemmy.one
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        You didn’t convert a hex number into Base64, you Base64 encoded the hex string.

        TL;DR, you used the wrong tool.

          • rnd@beehaw.org
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 months ago

            If you’re using Linux (or macOS or MinGW or CygWin or MSYS), you can do something like this in the terminal:

            xxd -r -ps | base64

            The first command will read the standard input and decode hex strings back into raw data, and the second one will do base64 to the output.

            If I pass the hex string mentioned in your original post through this command, I get:

            Z3nFNDK4ut8Em7nYkkpXhd2IckM=