Read the GSM 03.38 message class where the spec puts it (#95)
* Regression tests for the GSM 03.38 message class behind sms.flash * Read the GSM 03.38 message class where the spec puts it, and refuse a flash message no alphabet can carry * Keep the code span in the message-class decision on one line * Stop offering the flash message class as an alphabet, and check the encoding option by name * Settle every refusable send option in one check, and record what the review left open * Say what the flash refusal and the encoding option actually do * Keep the README off the alphabet whose long messages do not fit
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ export function bitCount(message: string, encoding?: EncodingName): number {
|
||||
const encoded = encodings[resolved].encode(message);
|
||||
|
||||
// GSM characters are packed seven bits to a septet; everything else stays octet-aligned.
|
||||
return resolved === 'ASCII' || resolved === 'FLASH' ? encoded.length * 7 : encoded.length * 8;
|
||||
return resolved === 'ASCII' ? encoded.length * 7 : encoded.length * 8;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user