https://github.com/johnnymast/morsecode
Encode or decode your morsecode messages with this package
https://github.com/johnnymast/morsecode
army communication decoder encoder morse morse-code
Last synced: 5 months ago
JSON representation
Encode or decode your morsecode messages with this package
- Host: GitHub
- URL: https://github.com/johnnymast/morsecode
- Owner: johnnymast
- License: mit
- Created: 2017-04-09T08:37:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-01T18:03:14.000Z (over 6 years ago)
- Last Synced: 2025-04-18T01:48:05.578Z (6 months ago)
- Topics: army, communication, decoder, encoder, morse, morse-code
- Language: PHP
- Homepage:
- Size: 31.3 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://travis-ci.org/johnnymast/morsecode)
[](https://scrutinizer-ci.com/g/johnnymast/morsecode/?branch=master)# Morsecode
This package allows you to encode or decode morsecode messages.
## Encoding
If you wish to encode your message you can use the encode method.
```php
use johnnymast\Morsecode\Morsecode;$morse = new Morsecode();
echo $morse->encode('This is a test');
```## Decoding
If you wish to decode your message you can use the decode method.
```php
use johnnymast\Morsecode\Morsecode;$morse = new Morsecode();
echo $morse->decode('- .... .. ... / .. ... / .- / - . ... -');
```## Alternative methods
You can also pass the message you wish you encode or decode via the constructor of the class like so.
```php
use johnnymast\Morsecode\Morsecode;$morse = new Morsecode('This is a test');
echo $morse->encode();
```## Return values
The encode and decode methods could return en empty string if no translation could be made. So please take note of this.
## Installation
Using [composer](http://www.getcompser.com):
```bash
$ composer require johnnymast/morsecode
```## Requirements
The following versions of PHP are supported by this version.
+ PHP >= 7.0
+ HHVM## Development Requirements
+ PHPUnit 5.7
## Author
This package is created and maintained by [Johnny Mast](https://github.com/johnnymast). If you have any questions feel free to contact me on twitter by using [@mastjohnny](https://twitter.com/intent/tweet?text=@mastjohnny) in your tweet.
## LicenseMIT License
Copyright (c) 2019 Johnny Mast
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.