stringstonumbers
v5.1.0
Published
Converts any string input into a number and back. Created to be used with the scratch-api module for transferring data over scratch cloud servers.
Downloads
8
Maintainers
Readme
stringstonumbers
Now in TypeScript!
stringstonumbers
is a very simple npm
package that converts any string input into a number and back. It was created to be used with the scratch-api module for transferring data over scratch cloud servers.
How to use
With npm
npm install stringstonumbers
Importing
const strToNum = require("stringstonumbers");
HTML
Want to use the script in the browser? No problem! Just import the script!
<script
type="application/javascript"
src="https://cdn.jsdelivr.net/npm/stringstonumbers@5/dist/browser.js"
></script>
Encoding
strToNum.encode("Hello World!");
// returns "07303737409122404337296200"
Decoding
strToNum.decode("07303737409122404337296200");
// returns "Hello World!"