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

Encode/Decode #42

Closed
simortus opened this issue Jul 26, 2020 · 7 comments
Closed

Encode/Decode #42

simortus opened this issue Jul 26, 2020 · 7 comments
Assignees

Comments

@simortus
Copy link

Hi, thanks for your contribution,
Can you tell what encoding are you using? i get unreadable chars on chirpstack! i want to add a chirpstack repo when I finalize this.
If you are around in Copenhagen, lets get that beer 👍

@sabas1080 sabas1080 added the Question a/Board Further information about a board is requested label Jul 27, 2020
@sabas1080
Copy link
Member

Hi @simortus What example are you using? Beautiful Copenhagen, I hope to return soon

@sabas1080
Copy link
Member

closed due to inactivity

@sabas1080 sabas1080 added wait feedback and removed Question a/Board Further information about a board is requested labels Aug 16, 2020
@simortus
Copy link
Author

simortus commented Aug 19, 2020 via email

@sabas1080 sabas1080 reopened this Aug 19, 2020
@sabas1080
Copy link
Member

@wolftrax5 can you help here?

@simortus
Copy link
Author

simortus commented Aug 19, 2020 via email

@wolftrax5
Copy link
Contributor

wolftrax5 commented Aug 19, 2020

how you are implementing that function? and witch version of her chirpstack server are you using, can you share how are you implementing. the bytes should be an array of numbers, if you receive strings this will never return somethings and on a resents versions of chirpstack server, has a template of decode function.

const data = [65,66,67]

function decode (bytes) {
  var result = ''
  for (var i = 0; i < bytes.length; ++i) {
    result += (String.fromCharCode(bytes[i]))
  }
  var decodedStr = (result).toString('base64')
  // var decodedStr = (result).toString();
  return decodedStr
}
console.log(decode(data))
//ABC

another way to decode

@sabas1080
Copy link
Member

closed due to inactivity

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

4 participants