harpo 1.0.5 harpo: ^1.0.5 copied to clipboard
A set of functions for numeric encryption and decryption. This is also a practical implementation of my algorithms for encryption and decrpytion.
Harpo #
About #
Harpo is a small library to numerically decrypt/encrypt letters, words, and phrases! Harpo is written in Dart and I thought I'd practice some Dart.
Installation #
"Naked Installation" #
Simply download the file and place it in your project together with all the other files ending in .dart
.
Adding to your project #
To add Harpo to your project's dependencies, add this to your project's pubspec.yml
:
From GitHub
dependencies:
...
harpo:
git: git://github.com/iammdsa/harpo.git
From Pub.dev
dependencies:
...
harpo: ^1.0.5
The three dots represent anything else that you might have in the dependencies
section.
Having done that, re-fetch your project's dependencies by running this in the project's root directory:
$ dart pub get
Support me #
If you want to help me, click the Sponsor button on the top right and click the PayPal link to support me. That link is my PayPal payment link. ;) I put in a lot of effort into my projects and I strive to make my projects excellent and perfect.
Usage #
Importing #
Import the file like this:
import 'package:harpo/harpo.dart';
API #
int encryptLetter(int factor, String letter)
This function encrypts a letter and expects a factor of type integer and a letter of type string. The function returns an integer.
String decryptLetter(int factor, int encryptedLetter)
This function decrypts a letter and expects a factor of type integer and a letter of type integer. This function returns a string.
String encryptWord(int factor, String word)
This function encrypts a word and expects a factor of type integer and a word of type String. The function returns a string of integers of type string.
String decryptWord(int factor, String encryptedWord)
This function decrypts an encrypted word and expects a factor of type integer and an encrypted word of type String. The function returns a string of letters of type string.
String encryptPhrase(int factor, String phrase)
This function encrypts a phrase and expects a factor of type integer and a phrase of type String. The function returns a string of integers of type string.
String decryptPhrase(int factor, String encryptedPhrase)
This function decrypts an encrypted phrase and expects a factor of type integer and an encrypted phrase of type String. The function returns a string of letters of type string.
String binToDec(String binaryNumber)
This function converts a binary number of type string into a decimal number of type string.
String decToBin(int decimalNumber)
This function converts a decimal number of type integer into a binary number of type string.
void testAll()
This function tests all of the above and prints out their results.
Note #
- Harpo by Alexander Abraham a.k.a. "MDSA"
- licensed under the MIT license