alma/elm-sms-length/1.0.0

NOTE: the latest version is 2.0.1

SmsLength

SmsLength

Utilities arround SMS messages and their length with regards to the necessary encoding.

How many chars are used, how much chars do I have by SMS?

charsUsed : Message -> Int

Tell the number of chars in a string

  • Handle the GSM Charset
  • Handle the GSM extended charset (a character counts for two 7-bit chars)
  • Handle the UCS-2 charset (all characters counts for 2 bytes)

A SMS is allowed for 140 bytes, multipart SMS needs a 7 bytes header to be linked to each other's.

charsInSms : Message -> Int

Tell the number of chars per SMS with regards to the mandatory message encoding

  • Handle the GSM Charset
  • Handle the GSM extended charset (a character counts for two 7-bit chars)
  • Handle the UCS-2 charset (all characters counts for 2 bytes)

A SMS is allowed for 140 bytes, multipart SMS needs a 7 bytes header to be linked to each other's.

How many SMS do I need?

numberOfSms : Message -> Int

Tell the number of SMS message mandatory with regards to the current message string and encoding