Passing base64 encoded strings in URL

前端 未结 10 1660
臣服心动
臣服心动 2020-11-22 03:11

Is it safe to pass raw base64 encoded strings via GET parameters?

10条回答
  •  梦毁少年i
    2020-11-22 04:00

    @joeshmo Or instead of writing a helper function, you could just urlencode the base64 encoded string. This would do the exact same thing as your helper function, but without the need of two extra functions.

    $str = 'Some String';
    
    $encoded = urlencode( base64_encode( $str ) );
    $decoded = base64_decode( urldecode( $encoded ) );
    

提交回复
热议问题