Skip to content

Commit bd42c15

Browse files
Merge pull request #23 from cryptohub-digital/update/fixes-01
Fixes
2 parents 7f64b8a + a6a42ae commit bd42c15

File tree

3 files changed

+65
-115
lines changed

3 files changed

+65
-115
lines changed

README.md

Lines changed: 60 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,71 @@
22

33
<img src="https://corecdn.info/badge/svg/128/txms.svg" width="128"/>
44

5-
## List of providers
5+
## List of Providers
66

7-
You can choose the most reliable provider for you and your region.
7+
Choose the provider most reliable for your needs and region.
88

99
[Open the TXMS Status page](https://txms.info)
1010

11-
## How does it work?
11+
## How Does It Work?
1212

13-
This tool using for conversion encoding UTF-16 Big Endian (UTF-16BE).
13+
This tool is used for converting HEX encoding to UTF-16 Big Endian (UTF-16BE).
1414

15-
### What is UTF-16 and (Big, Little) Endian?
15+
### What Are UTF-16 and (Big, Little) Endian?
1616

17-
UTF-16 is a character encoding capable of encoding all 1,112,064 valid code points of Unicode.
17+
UTF-16 is a character encoding that can encode all 1,112,064 valid Unicode code points.
1818

19-
Big-endian is an order in which the "big end" (most significant value in the sequence) is stored first, at the lowest storage address.
19+
Big-endian is an order in which the "big end" (most significant value in the sequence) is stored first at the lowest storage address.
2020

21-
Little-endian is an order, in which the "little end" (least significant value in the sequence) is stored first.
21+
In contrast, little-endian is an order where the "little end" (least significant value in the sequence) is stored first.
2222

2323
Byte Index | 0 | 1
2424
--- | --- | ---
2525
Big-Endian | 12 | 34
2626
Little-Endian | 34 | 12
2727

28-
## Practical use
28+
## Practical Use
2929

30-
### Negative №1
30+
### Disadvantage 1
3131

32-
SMS can encode 160 7-bit characters into 140 bytes, but even that not all characters represent 1 character. Certain characters in GSM 03.38 require an escape character, such as: `|, ^, {, }, €, [, ~, ]` and `\`.
32+
An SMS can encode 160 7-bit characters into 140 bytes. However, not all characters represent 1 character. Certain characters in GSM 03.38 require an escape character, such as: `|, ^, {, }, €, [, ~, ]` and `\`.
3333

34-
In Unicode SMS we are limited to 70 characters (or 67 in multipart SMS).
34+
For Unicode SMS, we are limited to 70 characters (or 67 in multipart SMS).
3535

36-
### Negative №2
36+
### Disadvantage 2
3737

38-
Most providers are not accepting `invisible control characters and unused code points`; or `any kind of invisible separator` and they are replacing them with the character `` `U+FFFD`.
38+
Most providers do not accept `invisible control characters and unused code points` or `any type of invisible separator`. They replace these with the character `` `U+FFFD`, which makes the transaction invalid.
3939

40-
This will make the transaction invalid.
40+
### Advantage 1
4141

42-
### Positive №1
42+
Modern providers and phones support UCS-2 (a now-defunct character encoding), which has been replaced with UTF-16 Big Endian (UTF-16BE).
4343

44-
Modern providers and phones are supporting UCS-2 (a now-defunct character encoding), which is replaced with UTF-16 Big Endian (UTF-16BE).
44+
### Advantage 2
4545

46-
### Positive №2
46+
To prevent the rejection of certain characters, we prefix them with a tilde `~` character ([007E](https://codepoints.net/U+007E)), followed by the 2+2 hex digits converted to Unicode characters.
4747

48-
To avoid non-acceptance of certain characters, we are prefixing them with a tilde `~` character ([007E](https://codepoints.net/U+007E)) following the 2+2 hex digits converted to Unicode characters.
49-
50-
Both 2 hex digits will get the `01` prefix.
48+
Both 2 hex digits receive the `01` prefix.
5149

5250
For example:
53-
1. We are getting hex `09CA`, which is not a valid Unicode character in [Bengali](https://codepoints.net/bengali).
54-
1. We are splitting it into two parts 2+2.
55-
1. First half we are prefixing with `01` and we are getting `0109`, which will be converted to [ĉ](https://codepoints.net/U+0109).
56-
1. Second part we are prefixing with `01` and we are getting `01CA`, which will be converted to [NJ](https://codepoints.net/U+01CA).
57-
1. Converted characters we are prefixing with `~` tilde.
58-
1. As a result we are getting the `~ĉNJ` string.
51+
1. We receive hex `09CA`, which is not a valid Unicode character in [Bengali](https://codepoints.net/bengali).
52+
1. We split it into two 2+2 parts.
53+
1. We prefix the first half with `01`, resulting in `0109`, which is converted to [ĉ](https://codepoints.net/U+0109).
54+
1. We prefix the second part with `01`, resulting in `01CA`, which is converted to [NJ](https://codepoints.net/U+01CA).
55+
1. The converted characters are prefixed with a `~` tilde.
56+
1. The result is the `~ĉNJ` string.
5957

60-
### Splitting Tx
58+
### Transaction Splitting
6159

62-
For dividing the transactions in the data feed you must use [Line feed](https://codepoints.net/U+000A) character. In script normally referred to as `\n` or `\r` depending on the OS.
60+
To divide transactions in the data feed, use the [Line feed](https://codepoints.net/U+000A) character. In scripts, this is usually referred to as `\n` or `\r`, depending on the OS.
6361

64-
### Result
62+
### Outcome
6563

66-
Based on these findings you should be able to send CORE transactions (or any other) encoded by UTF-16BE in modern networks and phones with SMS.
64+
Based on these findings, you should be capable of sending CORE transactions (or any others) encoded by UTF-16BE on modern networks and phones through SMS.
6765

6866
Notes:
69-
- In some cases, you need to swap the buffer from Little Endian to Big endian.
70-
- Base62 is one of the best tools to convert UTF-16 characters into ASCII.
71-
- We are excluding characters from UTF-16 Basic Multilingual Plane:
67+
- In some instances, you may need to swap the buffer from Little Endian to Big Endian.
68+
- Base62 is a great tool for converting UTF-16 characters into ASCII.
69+
- We exclude characters from the UTF-16 Basic Multilingual Plane:
7270
- tilde `~` character ([007E](https://codepoints.net/U+007E))
7371
- replacement ` ` character ([FFFD](https://codepoints.net/U+FFFD))
7472
- Control, Format, Unassigned, Private use, Surrogate characters
@@ -80,11 +78,11 @@ Core Blockchain transactions should be packed into 2-3 SMS messages.
8078

8179
#### Sending TXMS vs HEX
8280

83-
TXMS is shorter but dependent on UTF-16, which makes it with plain HEX comparison slightly better in the SMS use case.
81+
TXMS, while dependent on UTF-16, is shorter, making it slightly more efficient than plain HEX in the context of SMS.
8482

85-
But there is a big difference in the length of the message.
83+
However, there is a significant difference in the length of the messages.
8684

87-
In native systems, which are supporting UTF-16 you will get always the best or most competitive results.
85+
In native systems that support UTF-16, you will always achieve the best or most competitive results.
8886

8987
## Installation
9088

@@ -100,7 +98,7 @@ npm i txms.js
10098
yarn add txms.js
10199
```
102100

103-
## Use
101+
## Usage
104102

105103
### Importing
106104

@@ -126,7 +124,7 @@ var decoded = txms.decode(string);
126124

127125
### Parameters
128126

129-
- `hex` = hexadecimal representation of transaction without 0x prefix. (Even prefix is inserted, it is cutting it.)
127+
- `hex` = hexadecimal representation of transaction without 0x prefix. (If a prefix is present, it is removed.)
130128
- `data` = UTF-16BE data
131129
- `network` (default: 1) = ID of Core Blockchain network or its name (such as: mainnet, devin).
132130
- `countriesList` (default: all) = ISO 3166 Alpha-2 country/ies code/s.
@@ -159,53 +157,53 @@ $ echo {value} | txms {type} {location}
159157

160158
Unit tests are included and can be executed with the command `yarn test` or `npm run test`.
161159

162-
GitHub is automatically testing the commits into the source code.
160+
GitHub automatically tests the commits into the source code.
163161

164-
Feel free to contribute and extend our test cases.
162+
Contributions and extensions to our test cases are welcome.
165163

166164
### Test wallets
167165

168-
We are using the Core Blockchain - Devin (testnet) wallets for tests.
166+
We use the Core Blockchain - Devin (testnet) wallets for tests.
169167

170-
## Additional services
168+
## Additional Services
171169

172-
We can send an SMS back with the status and we are streaming success/fail statuses into the database.
170+
We can send an SMS back with the status and stream success/failure statuses into the database.
173171

174-
If you need an API endpoint or receive an SMS back to the sender's number, feel free to contact us.
172+
If you need an API endpoint or want to receive an SMS back to the sender's number, please contact us.
175173

176-
## SMS endpoint
174+
## SMS Endpoint
177175

178-
You can use our defined endpoints or create your service.
176+
You can use our predefined endpoints or create your own service.
179177

180-
To deliver the best results we are checking the online status of the service with the [uptime checker](https://github.com/gatestatus/txms).
178+
To provide the best results, we check the online status of the service with the [uptime checker](https://github.com/gatestatus/txms).
181179

182-
Follow the steps:
180+
Follow these steps:
183181
- Test your service.
184-
- Please, return the [200 "OK"](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) status code on the `yoururl.tld/ping` endpoint.
185-
- Raise the [Listing request](https://github.com/gatestatus/txms/issues/new?template=list.yml).
182+
- Return the [200 "OK"](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) status code at the `yoururl.tld/ping` endpoint.
183+
- Submit a [Listing request](https://github.com/gatestatus/txms/issues/new?template=list.yml).
186184

187185
## Security
188186

189-
This is not encrypting tool, but a conversion. All people can read your signed transaction, but don't worry they can do it in any case on Blockchain.
187+
This tool doesn't encrypt, it converts. Therefore, anyone can read your signed transaction, but don't worry as they could do this on the Blockchain anyway.
190188

191-
You should be safe. Don't stream your private key or any sensitive data that you want to protect.
189+
Stay safe. Do not broadcast your private key or any sensitive data you wish to safeguard.
192190

193191
## Contributions
194192

195-
Feel free to contribute in any way.
193+
You're welcome to contribute in any capacity.
196194

197-
We appreciate:
198-
- Fork [this repository](https://github.com/cryptohub-digital/txms.js/fork)
199-
- Open [pull request](https://github.com/cryptohub-digital/txms.js/pulls)
200-
- Create your own [SMS endpoint](#sms-endpoint)
201-
- Send us some Øres / ₡ores: [cb7147879011ea207df5b35a24ca6f0859dcfb145999](https://blockindex.net/address/cb7147879011ea207df5b35a24ca6f0859dcfb145999)
202-
- Star this repository
195+
We welcome:
196+
- Forking [this repository](https://github.com/cryptohub-digital/txms.js/fork)
197+
- Opening a [pull request](https://github.com/cryptohub-digital/txms.js/pulls)
198+
- Creating your own [SMS endpoint](#sms-endpoint)
199+
- Sending us some Øres / ₡ores: [cb7147879011ea207df5b35a24ca6f0859dcfb145999](https://blockindex.net/address/cb7147879011ea207df5b35a24ca6f0859dcfb145999)
200+
- Starring this repository
203201

204202
## Author
205203

206-
[CRYPTO ▪ HUB](https://www.github.com/cryptohub-digital) // [@rastislavcore](https://www.github.com/rastislavcore)
204+
[CRYPTO ▪ HUB](https://www.github.com/cryptohub-digital)
207205

208-
## Epigram
206+
## Motto
209207

210208
> 「Cryptoni Confidimus」
211209

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "txms.js",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Transaction messaging service protocol",
55
"keywords": [
66
"txms",

src/index.js

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -44,61 +44,13 @@ const txms = {
4444
const countries = {
4545
// Mainnet network
4646
1: {
47-
ag: [''],
48-
ai: [''],
49-
as: [''],
50-
bb: [''],
51-
bm: [''],
52-
bs: [''],
53-
ca: [''],
54-
dm: [''],
55-
do: [''],
56-
gd: [''],
57-
gu: [''],
58-
jm: [''],
59-
kn: [''],
60-
ky: [''],
61-
lc: [''],
62-
mp: [''],
63-
ms: [''],
64-
pr: [''],
65-
sx: [''],
66-
tc: [''],
67-
tt: [''],
68-
us: [''],
69-
vc: [''],
70-
vg: [''],
71-
vi: [''],
72-
um: ['']
47+
global: ['+12019715152'],
48+
us: ['+12019715152']
7349
},
7450
// Devin network
7551
3: {
76-
ag: [''],
77-
ai: [''],
78-
as: [''],
79-
bb: [''],
80-
bm: [''],
81-
bs: [''],
82-
ca: [''],
83-
dm: [''],
84-
do: [''],
85-
gd: [''],
86-
gu: [''],
87-
jm: [''],
88-
kn: [''],
89-
ky: [''],
90-
lc: [''],
91-
mp: [''],
92-
ms: [''],
93-
pr: [''],
94-
sx: [''],
95-
tc: [''],
96-
tt: [''],
97-
us: [''],
98-
vc: [''],
99-
vg: [''],
100-
vi: [''],
101-
um: ['']
52+
global: ['+12014835939'],
53+
us: ['+12014835939']
10254
}
10355
}
10456
const aliases = {

0 commit comments

Comments
 (0)