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

Feature Request: Simple Base64 Decoder #39

Open
hpssjellis opened this issue May 4, 2022 · 2 comments
Open

Feature Request: Simple Base64 Decoder #39

hpssjellis opened this issue May 4, 2022 · 2 comments

Comments

@hpssjellis
Copy link
Contributor

When I send data to Adafruit it is base64 encoded (I don't want to use cayanneLPP). Could we have a simple function here that just shows how to decode base64, or am I missing something that I can do from the console?

Should be something along theses lines

function Decoder(bytes, port) {

  return decoded;
}


// Define the string
var decodedStringBtoA = 'Hello World!';

// Encode the String
var encodedStringBtoA = btoa(decodedStringBtoA);

console.log(encodedStringBtoA);

// Define the string
var encodedStringAtoB = 'SGVsbG8gV29ybGQh';

// Decode the String
var decodedStringAtoB = atob(encodedStringAtoB);

console.log(decodedStringAtoB);



@hpssjellis
Copy link
Contributor Author

I sent in a pull request for a base64 decoder

#40

@Dangerousfish
Copy link

You can run "base64" and use -e to encode or -d to decode in most unix operating systems

Powershell has similar too:
decode
[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($EncodedText))

encode
$Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text)
$EncodedText =[Convert]::ToBase64String($Bytes)

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

No branches or pull requests

2 participants