I'm using the开发者_StackOverflow社区 base64_encode function to hash strings. The strings must be a-zA-Z0-9 and sometimes base64_encode outputs the = sign at the end (sometimes twice).
What is the most efficient way to alter the base64_encode function (override?) to omit the = signs?
The possible =s at the end are required if you want to decode the value later. Also, the character set a-zA-Z0-9 has only 62 values and thus a base-64 encoded value can never fit inside it.
Update: If you need to hash strings, why not use a hash function? md5 should be a good go-to solution unless the application is security-sensitive, in which case a stronger hash (sha1 or better) should be used.
As Jon said you need the = to decode it later but from what you say you don't need to do that, in which case your better off using md5 instead, this will give you a 32 character A-F/0-9 string.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论