base64 decode brings back weird characters

I know this question has been asked before (I searched across a ton of answers with no luck). So, I am finally just asking my own question with my own example. I have a base64 string in a database. Here is the string: base64:YW5vaXRoZXIgcmVwbHk=CgpNc2cgJiBkYXRhIHJhdGVzIG1heSBhcHBseS4gTXNnIGZyZXF1ZW5jeSB2YXJpZXMuIFJlcGx5IEhFTFAgZm9yIGhlbHAuIFJlcGx5IFNUT1AgdG8gY2FuY2VsLg== I try and decode it using a simple base64_decode() and I… Read More base64 decode brings back weird characters

How to convert base64 byte to string byte without extra slashes and b''

I want convert this base64 string to a byte string like this: base64: XHhjXHg0OFx4ODNceGU0XHgwXHhlOFx4Y2NceDAwXHgwMFx4MDBceDQxXA== string byte: \xc\x48\x83\xe4\x0\xe8\xcc\x00\x00\x00\x41\ I made this code: import base64 bstring = "XHhjXHg0OFx4ODNceGU0XHgwXHhlOFx4Y2NceDAwXHgwMFx4MDBceDQxXA==" decoded = base64.b64decode(bstring) print(decoded) And this is the output: b’\\xc\\x48\\x83\\xe4\\x0\\xe8\\xcc\\x00\\x00\\x00\\x41\\’ So this is the problem. I don’t wanna double slash and b” so how can I convert it like… Read More How to convert base64 byte to string byte without extra slashes and b''

Resizing base64 to percentage of original in react-native

I am rendering some base64 images in my react-native app, and it is working. However, right now it only seems to work when I assign a fixed height and width: <View> <Image source={{ uri: logoStr, }} style={styles.logo} /> </View> const styles = StyleSheet.create({ // other styles logo: { width: 270, height: 320, marginTop: ‘10%’, },… Read More Resizing base64 to percentage of original in react-native

Is there any way to remove the b'' from decoded base64 output?

When i run import base64 a = "aHR0cHM6Ly9kaXNjb3JkLmNvbS9hcGkvd2ViaG9va3MvMTA2MTQ2NzIxNDI2MTI2MDMwOC9wNklOLWgzVkRGSEo1UVIyNDVSXy1NUFlWZ2xfU2tRZ3RUemVPMUN2SGlUZlBSMEExSjhOQUdHVmt0NU1sZzhrYXVkRg==" hook = base64.b64decode(a) print(hook) It returns: b’https://discord.com/api/webhooks/1061467214261260308/p6IN-h3VDFHJ5QR245R_-MPYVgl_SkQgtTzeO1CvHiTfPR0A1J8NAGGVkt5Mlg8kaudF&#8217; But i want it to only return https://discord.com/api/webhooks/1061467214261260308/p6IN-h3VDFHJ5QR245R_-MPYVgl_SkQgtTzeO1CvHiTfPR0A1J8NAGGVkt5Mlg8kaudF not the b”. Is there anyway to fix the problem? I know it says it because the type is byte. >Solution : That’s a bytes value that should be decoded to a… Read More Is there any way to remove the b'' from decoded base64 output?

I have this error System.ServiceModel.Security.MessageSecurityException

For what I read and understood, this happens when I’m not sending the authentication. But I tried to send it in two ways: string userN = "username"; string _pasw = "password"; BasicHttpBinding binding = new BasicHttpBinding(); Endpoint wsdl = new Endpoint("MyEndpoint"); SoapClient client = new SoapClient(binding, wsdl); client.ClientCredentials.UserName.UserName = userN; client.ClientCredentials.UserName.Password = _pasw; await client.OpenAsync();… Read More I have this error System.ServiceModel.Security.MessageSecurityException