Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
gverni-test-package
Advanced tools
This repo contains a package for an SMS segments calculator. The package is released as a nodeJS package as well as a browser script. A browser demo for this package can be accessed here
The package can be installed using:
npm install --save sms-segments-calculator
Sample usage:
const { SegmentedMessage } = require('sms-segments-calculator');
const segmentedMessage = new SegmentedMessage('Hello World');
console.log(segmentedMessage.encodingName); // "GSM-7"
console.log(segmentedMessage.segmentsCount); // "1"
You can add the library to your page using the CDN file:
<script src="https://cdn.jsdelivr.net/gh/TwilioDevEd/message-segment-calculator/docs/scripts/segmentsCalculator.js" integrity="sha256-wXuHVlXNhEWNzRKozzB87Qyi9/3p6LKskjDXFHIMInw=" crossorigin="anonymous"></script>
Alternatively you can add the library to your page using the file segmentsCalculator.js
provided in docs/scripts/
and adding it to your page:
<script type="text/javascript" src="scripts/segmentsCalculator.js"></script>
And example of usage can be find in docs/index.html
SegmentedMessage
classThis is the main class exposed by the package
constructor(message, encoding)
Arguments:
message
: Body of the SMSencoding
: Optional: encoding. It can be GSM-7
, UCS-2
, auto
. Default value: auto
encodingName
Returns the name of the calculated encoding for the message: GSM-7
or UCS-2
totalSize
Total size of the message in bits (including User Data Header if present)
messageSize
Total size of the message in bits (excluding User Data Header if present)
segmentsCount
Number of segment(s)
If you want to test the library you can use the script provided in playground/index.js
. Install the dependencies (npm install
) and then run:
$ node playground/index.js "👋 Hello World 🌍"
This code is open source and welcomes contributions. All contributions are subject to our Code of Conduct.
The source code for the library is all contained in the src
folder. Before submitting a PR:
npm run lint
command and make sure there are no linter errornpm run build
command and make sure there are no errorsnpm test
and make sure all tests passnpm run webpack
and test the web page in docs/index.html
No warranty expressed or implied. Software is as is.
FAQs
SMS segements calculator
The npm package gverni-test-package receives a total of 12 weekly downloads. As such, gverni-test-package popularity was classified as not popular.
We found that gverni-test-package demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.