Home / CodesToolkit JavaScript library

CodesToolkit JavaScript library

Version 0.1.0, released December 3, 2026

A small JavaScript library with the same Morse, binary, hex, ASCII, Roman numeral, NATO alphabet, Caesar, ROT13 and braille converters that run the tools on this site. It has no other libraries to install, makes no network requests and keeps nothing in storage. MIT License.

Author: CodesToolkit. There is no named individual author. Bug reports are welcome on the contact page. The source is on Codeberg.

Download

Source on Codeberg

Library files, sizes and SHA-256 checksums
FileWhat it isSizeSHA-256
codestoolkit-0.1.0.zipZip of the library, tests, typings, licence and changelog24.0 KBd69cdb3717404e3b9a42141ff6bfd662d5b86af76c8a731558d39809e76e15aa
codestoolkit.jsSingle-file build for a script tag, or for require() in Node17.1 KBa3da9cb355f7065ba7a5dd3dcf6e6bda9c5d968a3997e8962b669a9dc9c5691e
codestoolkit.mjsSingle-file ES module for import in a browser or in Node17.5 KBb9194fbf8a073e693f2228a9bad44df6139cb1f8a8550e76b08bc3a7240b11b4
codestoolkit.d.tsTypeScript typings for the same functions2.5 KBe9e82763e282d75fc3ff3eafb1bfb444b63db9d77172399545db6142c2889e50
LICENSE.txtMIT License1.0 KB2c53ea618744be8f01c449008d118c78fd8c9babafb0b43d94244cf06322d9ff
CHANGELOG.mdChanges in this and later versions413 bytes34a61542c9556a4b879c20808185eb9b4b5b7ae4804c2eeeb53415eb26983211

The zip unpacks to a folder named codestoolkit-0.1.0. The single-file builds are also in that folder, under src/, as index.js and index.mjs.

How to load it

In a web page, with a script tag

<script src="https://codestoolkit.com/library/codestoolkit.js"></script>
<script>
  const result = CTK.morseEncode('SOS');
  console.log(result.out);  // ... --- ...
</script>

In a web page, as an ES module

<script type="module">
  import { morseEncode, textToBinary, numberToRoman } from 'https://codestoolkit.com/library/codestoolkit.mjs';
  console.log(morseEncode('SOS').out);
  console.log(textToBinary('Hi').out);
  console.log(numberToRoman('2026').out);
</script>

The .mjs file is sent with an Access-Control-Allow-Origin: * header, so a page on another site can import it directly. You can also download the file and host it yourself.

In Node.js

Download the zip or the single file, put it next to your script, and load it like this (Node 14 or later):

const ctk = require('./codestoolkit.js');   // or: import * as ctk from './codestoolkit.mjs'
console.log(ctk.morseEncode('SOS 2026').out);
console.log(ctk.hexToText('48 69').out);
console.log(ctk.caesar('Hello, World!', 3));

What you get back

Every translator returns an object with three fields:

caesar(text, shift), rot13(text) and allShifts(cipher) return ordinary values (a string, or pairs of shift and text) because those functions cannot fail.

Functions

Functions exported by the library
AreaFunctions
Morse (International Morse, ITU-R M.1677-1 characters)morseEncode, morseDecode, morseSchedule, morseUnits, unitMs, MORSE, morseOrder
Binary and numberstextToBinary, binaryToText, decToBin, binToDec
HextextToHex(text, {sep, prefix, upper}), hexToText, decToHex, hexToDec
ASCII (codes 0 to 127; base 2, 8, 10 or 16)textToAscii, asciiToText, asciiRow
Roman numerals (1 to 3999)numberToRoman, romanToNumber, toRomanInt, romanPairs
NATO / ICAO spelling alphabetnatoEncode, natoDecode, NATO_LETTERS, NATO_DIGITS
Caesar and ROT13caesar, caesarEncode, caesarDecode, rot13, allShifts
Braille (uncontracted English, Unicode U+2800 block)brailleEncode, brailleDecode, brailleCell, BRAILLE

TypeScript typings ship with the files. Text conversions to binary and hex use UTF-8 bytes; the ASCII functions refuse characters above code 127 instead of guessing.

Limits you should know about

Tests

The zip includes a test suite. From the unpacked folder run:

node test/test_codes.js && node test/test_package.js

That runs about 77,000 assertions: the International Morse table written out independently of the implementation, random round trips for every converter (with a fixed seed), every Roman numeral from 1 to 3999, every ASCII code in four bases, braille cases, a check that the CommonJS, ES module and TypeScript entry points agree, and a check that the library contains no network or storage calls.

Changelog

0.1.0 — 2026-12-03

First public release. The converters that run the tools at [codestoolkit.com](https://codestoolkit.com/), released as a small, zero-dependency JavaScript library: Morse code, binary, hexadecimal, ASCII, Roman numerals, the NATO phonetic alphabet, Caesar / ROT13 and uncontracted braille. MIT License. Hosted at [codestoolkit.com/library/](https://codestoolkit.com/library/).

Licence

MIT License. Copyright (c) 2026 CodesToolkit. The official text is in LICENSE.txt:

MIT License

Copyright (c) 2026 CodesToolkit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

How this code was written

The converters were taken, unchanged, from the code that runs the tools on this site, together with their tests. Parts of the code and the explanatory text were drafted with AI assistance and then checked against the cited sources (ITU-R M.1677-1 for Morse, RFC 20 for ASCII, RFC 3629 for UTF-8, and Wikipedia for the other codes) and by the tests above. No individual author is named.