cawfree / OpenChirp

A reverse-engineered implementation of the Chirp data-over-audio protocol.
Apache License 2.0
88 stars 19 forks source link

[Question] Extend range to support all characters in Base64 encoding #5

Open landicefu opened 4 years ago

landicefu commented 4 years ago

Hi @cawfree , I wonder how can I extend the range to support more characters.

This was my try, but it doesn't work.

val DEFAULT_RANGE: Range = Range("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", 0x43, 63)

I am not sure how to debug this, but the last frequency already higher than 66K. Can this be the problem?

wisehackermonkey commented 3 years ago

i think this has to do with the character encoding as part of the chrip.io protocol standard alphabet is the character class [0-9a-v]

Each chirp is uniquely identified by an alphanumeric string known as its identifier 
-- for example, "e6hn81aan7". In our standard product, this comprises of 10 
characters drawn from our 32-character alphabet. Every valid chirp object has 
an identifier, and the characters of this code are mapped to audio frequencies 
to generate the Chirp tone.

The standard alphabet is the character class [0-9a-v].

0123456789abcdefghijklmnopqrstuv
This gives 5 bits of data per character, making 50 bits of data in total.

Each of the Chirp SDKs include convenience methods for the creation and validation of identifiers.

NOTE: chrip.io is now dead so check out this wayback machine link to their docs about the protocol character encoding

https://web.archive.org/web/20171006091450/http://developers.chirp.io/docs/chirps-shortcodes

Hope that is helpful.

wisehackermonkey commented 3 years ago

https://github.com/cawfree/OpenChirp/issues/3#issuecomment-411373688