Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Morse code translator, morse encoder and decoder, which can also generate audio.
Morse code encoder and decoder with no dependencies supports Latin, Cyrillic, Greek, Hebrew, Arabic, Persian, Japanese, Korean, Thai, and Unicode (Chinese and the others) characters with audio generation functionality using the Web Audio API.
See Morse Translator in action: https://morsify.net
$ npm install morsify --save
$ yarn add morsify
const morsify = require('morsify');
const encoded = morsify.encode('SOS'); // ... --- ...
const decoded = morsify.decode('... --- ...'); // SOS
const characters = morsify.characters(); // {'1': {'A': '.-', ...}, ..., '11': {'ㄱ': '.-..', ...}}
const audio = morsify.audio('SOS');
audio.play(); // play audio
audio.stop(); // stop audio
Or alternatively, you can also use the library directly with including the source file.
<script src="https://rawgit.com/ozdemirburak/morsify/master/dist/morsify.min.js"></script>
<script>
var encoded = morsify.encode('SOS'); // ... --- ...
var decoded = morsify.decode('... --- ...'); // SOS
var characters = morsify.characters(); // {'1': {'A': '.-', ...}, ..., '11': {'ㄱ': '.-..', ...}}
var audio = morsify.audio('SOS');
var oscillator = audio.oscillator; // OscillatorNode
var context = audio.context; // AudioContext
var gainNode = audio.gainNode; // GainNode
audio.play(); // play audio
audio.stop(); // stop audio
</script>
You can customize the dash, dot or space characters and specify the alphabet with the priority option for an accurate encoding and decoding.
What priority option does is, gives direction to the plugin to start to searching for the given character set first.
Set the priority option according to the list below.
const cyrillic = morsify.encode('Ленинград', { priority: 5 }); // .-.. . -. .. -. --. .-. .- -..
const greek = morsify.decode('... .- --. .- .--. .--', { priority: 6 }); // ΣΑΓΑΠΩ
const hebrew = morsify.decode('.. ––– . –––', { dash: '–', dot: '.', priority: 7 }); // יהוה
const japanese = morsify.encode('NEWS', { priority: 10, dash: '-', dot: '・', separator: ' ' }); // -・ ・ ・-- ・・・
const chinese = morsify.encode('你好', { priority: 13 }); // -..----.--..... -.--..-.-----.-
const characters = morsify.characters({ dash: '–', dot: '•' }); // {'1': {'A': '•–', ...}, ..., '11': {'ㄱ': '•–••', ...}}
const arabicAudio = morsify.audio('البراق', { // generates the morse .- .-.. -... .-. .- --.- then generates the audio from it
unit: 0.1, // period of one unit, in seconds, 1.2 / c where c is speed of transmission, in words per minute
oscillator: {
type: 'sine', // sine, square, sawtooth, triangle
frequency: 500, // value in hertz
onended: function () { // event that fires when the tone has stopped playing
console.log('ended');
}
}
});
const oscillator = arabicAudio.oscillator; // OscillatorNode
const context = arabicAudio.context; // AudioContext;
const gainNode = audio.gainNode; // GainNode
arabicAudio.play(); // will start playing morse audio
arabicAudio.stop(); // will stop playing morse audio
Contributions are welcome.
Install node and npm following one of the techniques explained within this link and run the commands below.
$ npm install --global gulp-cli
$ npm install
$ gulp
The MIT License (MIT). Please see License File for more information.
FAQs
Morse code translator, Morse encoder and decoder which can also generate audio.
The npm package morsify receives a total of 13 weekly downloads. As such, morsify popularity was classified as not popular.
We found that morsify 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.