• Custom User Avatar

    Note: This kata uses the non-padding version ("=" is not added to the end).

    Some reading will help

  • Custom User Avatar

    Just like how alphabets are handled.

  • Custom User Avatar

    I have this problem:

    Traceback (most recent call last):
    File "/workspace/default/.venv/lib/python3.10/site-packages/codewars_test/test_framework.py", line 112, in wrapper
    func()
    File "/workspace/default/tests.py", line 52, in __
    test.assert_equals(from_base_64(s), expected)
    File "/workspace/default/solution.py", line 7, in from_base_64
    a = base64.b64decode(b)
    File "/usr/local/lib/python3.10/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
    binascii.Error: Incorrect padding

    What should I do to fix it?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I really don't remember what this was about, but are you referring to this?

    Note: This kata uses the non-padding version ("=" is not added to the end).

    Because I think that must have been added to the description after I had written the comment.

  • Custom User Avatar

    This does not confront to standards in 2023 ~!

  • Custom User Avatar

    Sure, that's the misfortune of badly specified katas...

  • Custom User Avatar

    as you can see there are many issues about the padding problem; basically in JS the builtin decode function is lenient and will handle encoded strings with no padding, but in Python this throws an error. I dont know what was the author intent, the sentence about the padding got added to the description by someone else years after the kata was created. builtins for all languages will also generate padding when encoding.

    i dont know what's the best course of action to salvage the kata; it seems unfair to invalidate hundreds of solutions because specs were unclear.

  • Custom User Avatar
  • Custom User Avatar

    Note: This kata uses the non-padding version ("=" is not added to the end).

    This is enforced in Python, but not in C# and JavaScript

  • Custom User Avatar

    the kata supports Swift 5.3 as of now

  • Custom User Avatar

    Removed + description unified.

  • Custom User Avatar

    there are several flavors of base64 and in this kata padding is not required for either encoding or decoding. the description says :

    Note: This kata uses the non-padding version ("=" is not added to the end).

  • Custom User Avatar

    re-raised with language details

  • Custom User Avatar

    re-raised as an issue

  • Loading more items...