Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert.ToBase64String is not working properly #773

Closed
Ellerbach opened this issue Jun 6, 2021 · 0 comments · Fixed by nanoframework/CoreLibrary#145
Closed

Convert.ToBase64String is not working properly #773

Ellerbach opened this issue Jun 6, 2021 · 0 comments · Fixed by nanoframework/CoreLibrary#145

Comments

@Ellerbach
Copy link
Member

Details about Problem

nanoFramework area: C# code

Target: At least nanoCLR Win32 application, not tested on real device

Device capabilities output:

Description

Convert.ToBase64String is not working properly.

Detailed repro steps so we can see the same problem

const string SharedAccessKey = "dGVzdFN0cmluZzE=";
byte[] key = Convert.FromBase64String(SharedAccessKey);
Debug.WriteLine($"Key: {SharedAccessKey}");
Debug.WriteLine($"Key lenght: {key.Length}");
Debug.WriteLine($"Key: {Convert.ToBase64String(key)}");

Expected:

Key: dGVzdFN0cmluZzE=
Key lenght: 11
Key: dGVzdFN0cmluZzE=

Result:

Key: dGVzdFN0cmluZzE=
Key lenght: 11
Key: 

Other suggested things

Expected behaviour

Sample Project

Screenshot

Additional context

I've made an effort to fix the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants