Remove trailing “=” when base64 encoding

前端 未结 9 2056
时光取名叫无心
时光取名叫无心 2020-11-29 23:58

I am noticing that whenever I base64 encode a string, a \"=\" is appended at the end. Can I remove this character and then reliably decode it later by adding it back, or is

9条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 00:11

    If you're using PHP the following function will revert the stripped string to its original format with proper padding:

提交回复
热议问题