Compare commits

...
66 Commits
Author SHA1 Message Date
n1474335 339c741a2c 9.22.2 2021-02-01 16:14:38 +00:00
n1474335 d1bde23f00 Merge branch 'n1073645-datetime' 2021-02-01 16:13:57 +00:00
n1474335 be544faf0f Merge branch 'datetime' of https://github.com/n1073645/CyberChef into n1073645-datetime 2021-02-01 16:13:43 +00:00
n1474335 eff77fd3bb 9.22.1 2021-02-01 16:11:46 +00:00
n1474335 3df57ba3dd Added big and little endian options for Windows timestamp conversion ops 2021-02-01 16:11:39 +00:00
n1474335 4bae662357 Merge branch 'n1073645-FiletimeEndianness' 2021-02-01 15:56:03 +00:00
n1474335 357c90546e Merge branch 'FiletimeEndianness' of https://github.com/n1073645/CyberChef into n1073645-FiletimeEndianness 2021-02-01 15:55:42 +00:00
n1474335 54769a90ac 9.22.0 2021-02-01 15:52:34 +00:00
n1474335 0550aedd54 Merge branch 'mattnotmitt-features/unicode-format' 2021-02-01 15:51:29 +00:00
n1474335 5947ed21fc Tidied up localisation in Wikipedia URL 2021-02-01 15:51:14 +00:00
n1474335 0a0949246f Merge branch 'features/unicode-format' of https://github.com/mattnotmitt/CyberChef into mattnotmitt-features/unicode-format 2021-02-01 15:45:21 +00:00
n1474335 09c6e181fb 9.21.6 2021-02-01 14:42:32 +00:00
n1474335 02cf394bcd ROT13 tweaks 2021-02-01 14:42:00 +00:00
n1474335 46afbf9888 Merge branch 'n1073645-numberRot' 2021-02-01 14:37:44 +00:00
n1474335 7cf19d22a8 Merge branch 'numberRot' of https://github.com/n1073645/CyberChef into n1073645-numberRot 2021-02-01 14:37:30 +00:00
n1474335 46d708360f Merge branch 'xavier630-patch-1' 2021-02-01 14:32:05 +00:00
n1474335 7ec91e2366 Merge branch 'patch-1' of https://github.com/xavier630/CyberChef into xavier630-patch-1 2021-02-01 14:31:42 +00:00
n1474335 a74ee47bf0 Updated actions config 2021-02-01 14:18:17 +00:00
n1474335 7b68b92498 Updated actions config 2021-02-01 14:14:40 +00:00
n1474335 274f3acd45 Added GH Releases and NPM actions 2021-02-01 14:10:21 +00:00
n1474335 53dff8b30f 9.21.5 2021-02-01 11:10:16 +00:00
n1474335 9892ee273e Bugfix: ECC mode now works correctly in 'Generate PGP Key Pair' 2021-02-01 11:10:04 +00:00
n1474335 7dccecb336 Moved GH Pages prep to its own step 2021-01-22 17:15:58 +00:00
n1474335 aa09da0403 GitHub Actions now pushes to GitHub Pages 2021-01-22 17:13:17 +00:00
n1474335 98d7f1481c Improved UI tests 2021-01-22 16:52:37 +00:00
n1474335 7d8bdbcf7e Improved UI tests 2021-01-22 16:39:04 +00:00
n1474335 db009d3689 Improved UI tests 2021-01-22 16:25:19 +00:00
n1474335 d7bc529a95 Improved UI tests 2021-01-22 16:16:11 +00:00
n1474335 3f035294a6 Improved UI tests 2021-01-22 16:06:44 +00:00
n1474335 36282e362f Improved UI tests 2021-01-22 15:53:56 +00:00
n1474335 223353cf4d Increased UI test operation timeout 2021-01-22 15:43:18 +00:00
n1474335 ded32da632 Back to a single job 2021-01-22 15:33:15 +00:00
n1474335 d6fc21cc34 Fixed yaml 2021-01-22 15:28:46 +00:00
n1474335 b86e960456 Actions broken out into separate jobs 2021-01-22 15:27:42 +00:00
n1474335 7747bfe0f2 Fixed prod build and Actions now creates a sitemap 2021-01-22 15:17:17 +00:00
n1474335 fabea8cc61 Fix whitespace 2021-01-22 15:00:15 +00:00
n1474335 de4cd2eebc Add production build to GitHub Actions script 2021-01-22 14:59:26 +00:00
n1474335 e16ce1d9c2 Specify node version 2021-01-22 14:53:53 +00:00
n1474335 345ad741b3 Fixed sed command in postinstall script to be platform dependent 2021-01-22 14:47:33 +00:00
n1474335 e53108c493 Merge branch 'gh-actions' 2021-01-22 14:33:48 +00:00
n1474335 6129378854 Reduced Actions script to just linting and testing 2021-01-22 14:33:35 +00:00
n1474335 11a1416dcc Merge branch 'gh-actions' of https://github.com/mattnotmitt/CyberChef into mattnotmitt-gh-actions 2021-01-22 14:17:29 +00:00
n1474335 9025538544 9.21.4 2021-01-22 13:48:30 +00:00
n1474335 46929e1844 Merge branch 'mattnotmax-haversine' 2021-01-22 13:48:19 +00:00
n1474335 bf023cad48 Merge branch 'haversine' of https://github.com/mattnotmax/CyberChef into mattnotmax-haversine 2021-01-22 13:48:04 +00:00
n1474335 f649236bad 9.21.3 2021-01-22 13:45:24 +00:00
n1474335 54b1454c0a Merge branch 'n1073645-binaryLength' 2021-01-22 13:45:09 +00:00
n1474335 a41b1c2f5e Merge branch 'binaryLength' of https://github.com/n1073645/CyberChef into n1073645-binaryLength 2021-01-22 13:44:49 +00:00
mattnotmax 39b7e4ff9e Correct Haversine test output 2020-12-09 21:12:26 +11:00
mattnotmax a1109c43f6 Fix for haversine distance bug 2020-12-08 21:17:43 +11:00
Xavier Downs 3e8dea73d2 Update ScanForEmbeddedFiles.mjs 2020-11-24 12:18:02 +00:00
n1073645 bbf19ee944 argument added for numbers in ROT 2020-08-24 11:24:25 +01:00
n1073645 f6c8c9e76c swap endianness argument added to Windows Filetime To Unix Timestamp 2020-08-24 10:39:18 +01:00
n1073645 9dba1232b7 byte length argument added to ToBinary 2020-08-24 09:41:05 +01:00
Matt bf14c8983f trigger travis 2020-08-19 11:04:09 +01:00
Matt 3ab95384df Add unicode tests 2020-08-19 10:55:29 +01:00
n1073645 953a581a94 byte length arg added 2020-08-17 14:12:29 +01:00
n1073645 3bfddd708c rectify week number 2020-08-17 10:40:00 +01:00
Matt 13a54ec318 Add unicode text format operation 2020-08-13 12:36:02 +01:00
Matt 0b5ee7c79f Update actions 2020-07-04 15:35:49 +01:00
Matt 23cbe1c426 Merge branch 'master' into gh-actions 2020-07-04 15:29:24 +01:00
Matt 123a0ccd70 Changed pages workflow 2019-09-30 14:41:14 +01:00
Matt 4c737475d4 Forgot to run prod build 2019-09-30 14:08:23 +01:00
Matt 4e0d97f2c1 Added sudo 2019-09-30 14:02:22 +01:00
Matt 85906cafbb Adjustment 2019-09-30 13:56:26 +01:00
Matt a8dc691033 Try using github actions
Gonna monch this commit once i know it works
2019-09-30 13:51:38 +01:00
27 changed files with 372 additions and 112 deletions

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
name: Master
on:
push:
branches:
- master
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set node version
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Install
run: |
npm install
export NODE_OPTIONS=--max_old_space_size=2048
- name: Lint
run: npx grunt lint
- name: Unit Tests
run: |
npm test
npx grunt testnodeconsumer
- name: Production Build
if: success()
run: npx grunt prod
- name: Generate sitemap
run: npx grunt exec:sitemap
- name: UI Tests
if: success()
run: xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
- name: Prepare for GitHub Pages
if: success()
run: npx grunt copy:ghPages
- name: Deploy to GitHub Pages
if: success() && github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: ./build/prod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+55
View File
@@ -0,0 +1,55 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set node version
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Install
run: |
npm install
export NODE_OPTIONS=--max_old_space_size=2048
- name: Lint
run: npx grunt lint
- name: Unit Tests
run: |
npm test
npx grunt testnodeconsumer
- name: Production Build
if: success()
run: npx grunt prod
- name: UI Tests
if: success()
run: xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
- name: Upload Release Assets
if: success()
id: upload-release-assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/prod/*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Publish to NPM
if: success()
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
-55
View File
@@ -1,55 +0,0 @@
language: node_js
node_js:
- lts/dubnium
cache: npm
os: linux
addons:
chrome: stable
install: npm install
before_script:
- npm install -g grunt
- export NODE_OPTIONS=--max_old_space_size=2048
script:
- grunt lint
- npm test
- grunt testnodeconsumer
- grunt prod --msg="$COMPILE_MSG"
- xvfb-run --server-args="-screen 0 1200x800x24" grunt testui
before_deploy:
- grunt exec:sitemap
- grunt copy:ghPages
deploy:
- provider: pages
edge: true
token: $GITHUB_TOKEN
local_dir: build/prod/
target_branch: gh-pages
on:
repo: gchq/CyberChef
branch: master
- provider: releases
edge: true
token:
secure: "HV1WSKv4l/0Y2bKKs1iBJocBcmLj08PCRUeEM/jTwA4jqJ8EiLHWiXtER/D5sEg2iibRVKd2OQjfrmS6bo4AiwdeVgAKmv0FtS2Jw+391N8Nd5AkEANHa5Om/IpHLTL2YRAjpJTsDpY72bMUTJIwjQA3TFJkgrpOw6KYfohOcgbxLpZ4XuNJRU3VL4Hsxdv5V9aOVmfFOmMOVPQlakXy7NgtW5POp1f2WJwgcZxylkR1CjwaqMyXmSoVl46pyH3tr5+dptsQoKSGdi6sIHGA60oDotFPcm+0ifa47wZw+vapuuDi4tdNxhrHGaDMG8xiE0WFDHwQUDlk2/+W7j9SEX0H3Em7us371JXRp56EDwEcDa34VpVkC6i8HGcHK55hnxVbMZXGf3qhOFD8wY7qMbjMRvIpucrMHBi86OfkDfv0vDj2LyvIl5APj/AX50BrE0tfH1MZbH26Jkx4NdlkcxQ14GumarmUqfmVvbX/fsoA6oUuAAE9ZgRRi3KHO4wci6KUcRfdm+XOeUkaBFsL86G3EEYIvrtBTuaypdz+Cx7nd1iPZyWMx5Y1gXnVzha4nBdV4+7l9JIsFggD8QVpw2uHXQiS1KXFjOeqA3DBD8tjMB7q26Fl2fD3jkOo4BTbQ2NrRIZUu/iL+fOmMPsyMt2qulB0yaSBCfkbEq8xrUA="
file_glob: true
file:
- build/prod/*.zip
- src/node/cjs.js
on:
repo: gchq/CyberChef
tags: true
- provider: npm
edge: true
email: "n1474335@gmail.com"
api_token:
secure: "UnDQL3Kh+GK2toL0TK3FObO0ujVssU3Eg4BBuYdjwLB81GhiGE5/DTh7THdZPOpbLo6wQeOwfZDuMeKC1OU+0Uf4NsdYFu1aq6xMO20qBQ4qUfgsyiK4Qgywj9gk0p1+OFZdGAZ/j1CNRAaF71XQIY6iV84c+SO4WoizXYrNT0Jh4sr2DA4/97G2xmJtPi0qOzYrJ09R56ZUozmqeik5G0pMRIuJRbpjS/7bZXV+N7WV0ombZc9RkUaetbabEVOLQ+Xx5YAIVq+VuEeMe9VBSnxY/FfCLmy1wJsjGzpLCyBI9nbrG4nw8Wgc2m8NfK9rcpIvBTGner9r2j60NVDkZ8kLZPrqXhq6AZMwa+oz6K5UQCqRo2RRQzSGwXxg67HY5Tcq+oNmjd+DqpPg4LZ3eGlluyP5XfG+hpSr9Ya4d8q8SrUWLxkoLHI6ZKMtoKFbTCSSQPiluW5hsZxjz3yDkkjsJw64M/EM8UyJrgaXqDklQu+7rBGKLfsK6os7RDiqjBWpQ7gwpo8HvY0O8yqEAabPz+QGkanpjcCOZCXFbSkzWxYy37RMAPu88iINVZVlZE4l+WJenCpZY95ueyy0mG9cyMSzVRPyX6A+/n4H6VMFPFjpGDLTD588ACEjY1lmHfS/eXwXJcgqPPD2gW0XdRdUheU/ssqlfCfGWQMTDXs="
on:
tags: true
branch: master
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/83c143a6822e218d5b34
on_success: change
on_failure: always
on_start: never
-4
View File
@@ -242,10 +242,6 @@ module.exports = function (grunt) {
entry: Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints),
output: {
publicPath: "",
globalObject: "this"
},
resolve: {
alias: {
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cyberchef",
"version": "9.21.2",
"version": "9.22.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "cyberchef",
"version": "9.21.2",
"version": "9.22.2",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef",
@@ -172,7 +172,7 @@
"testui": "grunt testui",
"testuidev": "npx nightwatch --env=dev",
"lint": "grunt lint",
"postinstall": "find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i '' -e '/\\.mjs/!s/\\(from \"\\.[^\"]*\\)\";/\\1.mjs\";/g'",
"postinstall": "bash postinstall.sh",
"newop": "node --experimental-modules src/core/config/scripts/newOperation.mjs"
}
}
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
# Add file extensions to Crypto-Api imports
if [[ "$OSTYPE" == "darwin"* ]]; then
find ./node_modules/crypto-api/src/ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i '' -e '/\.mjs/!s/\(from "\.[^"]*\)";/\1.mjs";/g'
else
find ./node_modules/crypto-api/src/ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i -e '/\.mjs/!s/\(from "\.[^"]*\)";/\1.mjs";/g'
fi
+1
View File
@@ -200,6 +200,7 @@
"ops": [
"Encode text",
"Decode text",
"Unicode Text Format",
"Remove Diacritics",
"Unescape Unicode Characters",
"Convert to NATO alphabet"
+7 -1
View File
@@ -31,6 +31,11 @@ class FromBinary extends Operation {
"name": "Delimiter",
"type": "option",
"value": BIN_DELIM_OPTIONS
},
{
"name": "Byte Length",
"type": "number",
"value": 8
}
];
this.checks = [
@@ -78,7 +83,8 @@ class FromBinary extends Operation {
* @returns {byteArray}
*/
run(input, args) {
return fromBinary(input, args[0]);
const byteLen = args[1] ? args[1] : 8;
return fromBinary(input, args[0], byteLen);
}
/**
+6 -3
View File
@@ -33,7 +33,7 @@ class GeneratePGPKeyPair extends Operation {
{
"name": "Key type",
"type": "option",
"value": ["RSA-1024", "RSA-2048", "RSA-4096", "ECC-256", "ECC-384"]
"value": ["RSA-1024", "RSA-2048", "RSA-4096", "ECC-256", "ECC-384", "ECC-521"]
},
{
"name": "Password (optional)",
@@ -59,12 +59,15 @@ class GeneratePGPKeyPair extends Operation {
* @returns {string}
*/
async run(input, args) {
const [keyType, keySize] = args[0].split("-"),
password = args[1],
let [keyType, keySize] = args[0].split("-");
const password = args[1],
name = args[2],
email = args[3];
let userIdentifier = "";
keyType = keyType.toLowerCase();
keySize = parseInt(keySize, 10);
if (name) userIdentifier += name;
if (email) userIdentifier += ` <${email}>`;
+2 -2
View File
@@ -41,8 +41,8 @@ class HaversineDistance extends Operation {
const lat1 = parseFloat(values[1]);
const lng1 = parseFloat(values[3]);
const lat2 = parseFloat(values[6]);
const lng2 = parseFloat(values[8]);
const lat2 = parseFloat(values[5]);
const lng2 = parseFloat(values[7]);
const TO_RAD = Math.PI / 180;
const dLat = (lat2-lat1) * TO_RAD;
+1 -1
View File
@@ -72,7 +72,7 @@ class ParseDateTime extends Operation {
"\nLeap year: " + date.isLeapYear() +
"\nDays in this month: " + date.daysInMonth() +
"\n\nDay of year: " + date.dayOfYear() +
"\nWeek number: " + date.weekYear() +
"\nWeek number: " + date.week() +
"\nQuarter: " + date.quarter();
return output;
+11 -2
View File
@@ -35,6 +35,11 @@ class ROT13 extends Operation {
type: "boolean",
value: true
},
{
name: "Rotate numbers",
type: "boolean",
value: false
},
{
name: "Amount",
type: "number",
@@ -51,8 +56,9 @@ class ROT13 extends Operation {
run(input, args) {
const output = input,
rot13Lowercase = args[0],
rot13Upperacse = args[1];
let amount = args[2],
rot13Upperacse = args[1],
rotNumbers = args[2];
let amount = args[3],
chr;
if (amount) {
@@ -68,6 +74,9 @@ class ROT13 extends Operation {
} else if (rot13Lowercase && chr >= 97 && chr <= 122) { // Lower case
chr = (chr - 97 + amount) % 26;
output[i] = chr + 97;
} else if (rotNumbers && chr >= 48 && chr <= 57) { // Numbers
chr = (chr - 48 + amount) % 10;
output[i] = chr + 48;
}
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ class RemoveDiacritics extends Operation {
this.name = "Remove Diacritics";
this.module = "Default";
this.description = "Replaces accented characters with their latin character equivalent.";
this.description = "Replaces accented characters with their latin character equivalent. Accented characters are made up of Unicode combining characters, so unicode text formatting such as strikethroughs and underlines will also be removed.";
this.infoURL = "https://wikipedia.org/wiki/Diacritic";
this.inputType = "string";
this.outputType = "string";
+1 -1
View File
@@ -41,7 +41,7 @@ class ScanForEmbeddedFiles extends Operation {
* @returns {string}
*/
run(input, args) {
let output = "Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any sufficiently long file is likely to contain these magic bytes coincidentally.\n",
let output = "Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treated as reliable. Any sufficiently long file is likely to contain these magic bytes coincidentally.\n",
numFound = 0;
const categories = [],
data = new Uint8Array(input);
+7 -1
View File
@@ -31,6 +31,11 @@ class ToBinary extends Operation {
"name": "Delimiter",
"type": "option",
"value": BIN_DELIM_OPTIONS
},
{
"name": "Byte Length",
"type": "number",
"value": 8
}
];
}
@@ -42,7 +47,8 @@ class ToBinary extends Operation {
*/
run(input, args) {
input = new Uint8Array(input);
return toBinary(input, args[0]);
const padding = args[1] ? args[1] : 8;
return toBinary(input, args[0], padding);
}
/**
@@ -34,7 +34,7 @@ class UNIXTimestampToWindowsFiletime extends Operation {
{
"name": "Output format",
"type": "option",
"value": ["Decimal", "Hex"]
"value": ["Decimal", "Hex (big endian)", "Hex (little endian)"]
}
];
}
@@ -65,11 +65,24 @@ class UNIXTimestampToWindowsFiletime extends Operation {
input = input.plus(new BigNumber("116444736000000000"));
if (format === "Hex") {
return input.toString(16);
let result;
if (format.startsWith("Hex")) {
result = input.toString(16);
} else {
return input.toFixed();
result = input.toFixed();
}
if (format === "Hex (little endian)") {
// Swap endianness
let flipped = "";
for (let i = result.length - 2; i >= 0; i -= 2) {
flipped += result.charAt(i);
flipped += result.charAt(i + 1);
}
result = flipped;
}
return result;
}
}
+67
View File
@@ -0,0 +1,67 @@
/**
* @author Matt C [me@mitt.dev]
* @copyright Crown Copyright 2020
* @license Apache-2.0
*/
import Operation from "../Operation.mjs";
import Utils from "../Utils.mjs";
/**
* Unicode Text Format operation
*/
class UnicodeTextFormat extends Operation {
/**
* UnicodeTextFormat constructor
*/
constructor() {
super();
this.name = "Unicode Text Format";
this.module = "Default";
this.description = "Adds Unicode combining characters to change formatting of plaintext.";
this.infoURL = "https://wikipedia.org/wiki/Combining_character";
this.inputType = "byteArray";
this.outputType = "byteArray";
this.args = [
{
name: "Underline",
type: "boolean",
value: "false"
},
{
name: "Strikethrough",
type: "boolean",
value: "false"
}
];
}
/**
* @param {byteArray} input
* @param {Object[]} args
* @returns {byteArray}
*/
run(input, args) {
const [underline, strikethrough] = args;
let output = input.map(char => [char]);
if (strikethrough) {
output = output.map(charFormat => {
charFormat.push(...Utils.strToUtf8ByteArray("\u0336"));
return charFormat;
});
}
if (underline) {
output = output.map(charFormat => {
charFormat.push(...Utils.strToUtf8ByteArray("\u0332"));
return charFormat;
});
}
// return output.flat(); - Not supported in Node 10, polyfilled
return [].concat(...output);
}
}
export default UnicodeTextFormat;
@@ -34,7 +34,7 @@ class WindowsFiletimeToUNIXTimestamp extends Operation {
{
"name": "Input format",
"type": "option",
"value": ["Decimal", "Hex"]
"value": ["Decimal", "Hex (big endian)", "Hex (little endian)"]
}
];
}
@@ -49,7 +49,17 @@ class WindowsFiletimeToUNIXTimestamp extends Operation {
if (!input) return "";
if (format === "Hex") {
if (format === "Hex (little endian)") {
// Swap endianness
let result = "";
for (let i = input.length - 2; i >= 0; i -= 2) {
result += input.charAt(i);
result += input.charAt(i + 1);
}
input = result;
}
if (format.startsWith("Hex")) {
input = new BigNumber(input, 16);
} else {
input = new BigNumber(input);
+12 -1
View File
@@ -392,11 +392,22 @@ function testOp(browser, opName, input, output, args=[]) {
.useCss()
.click("#clr-recipe")
.click("#clr-io")
.waitForElementNotPresent("#rec-list li.operation")
.expect.element("#input-text").to.have.value.that.equals("");
browser
.urlHash("recipe=" + recipeConfig)
.setValue("#input-text", input)
.waitForElementPresent("#rec-list li.operation")
.expect.element("#input-text").to.have.value.that.equals(input);
browser
.waitForElementVisible("#stale-indicator", 5000)
.pause(100)
.click("#bake")
.waitForElementPresent("#stale-indicator.hidden", 1000);
.pause(100)
.waitForElementPresent("#stale-indicator.hidden", 5000)
.waitForElementNotVisible("#output-loader", 5000);
if (typeof output === "string") {
browser.expect.element("#output-text").to.have.value.that.equals(output);
+2 -2
View File
@@ -588,7 +588,7 @@ Password: 034148`;
const result = await chef.generatePGPKeyPair("Back To the Drawing Board", {
keyType: "ECC-256",
});
assert.strictEqual(result.toString().length, 2007);
assert.strictEqual(result.toString().length, 2560);
}),
it("Generate UUID", () => {
@@ -656,7 +656,7 @@ Leap year: false
Days in this month: 31
Day of year: 187
Week number: 2001
Week number: 27
Quarter: 3`;
assert.strictEqual(result.toString(), expected);
}),
+1 -1
View File
@@ -69,7 +69,6 @@ import "./tests/ParseQRCode.mjs";
import "./tests/PowerSet.mjs";
import "./tests/Regex.mjs";
import "./tests/Register.mjs";
import "./tests/RemoveDiacritics.mjs";
import "./tests/Rotate.mjs";
import "./tests/SeqUtils.mjs";
import "./tests/SetDifference.mjs";
@@ -101,6 +100,7 @@ import "./tests/LuhnChecksum.mjs";
import "./tests/CipherSaber2.mjs";
import "./tests/Colossus.mjs";
import "./tests/ParseObjectIDTimestamp.mjs";
import "./tests/Unicode.mjs";
// Cannot test operations that use the File type yet
+12 -1
View File
@@ -11,7 +11,18 @@ TestRegister.addTests([
{
name: "Haversine distance",
input: "51.487263,-0.124323, 38.9517,-77.1467",
expectedOutput: "5619355.701829259",
expectedOutput: "5902542.836307819",
recipeConfig: [
{
"op": "Haversine distance",
"args": []
}
],
},
{
name: "Haversine distance, zero distance",
input: "51.487263,-0.124323, 51.487263,-0.124323",
expectedOutput: "0",
recipeConfig: [
{
"op": "Haversine distance",
@@ -1,22 +0,0 @@
/**
* Remove Diacritics tests.
*
* @author Klaxon [klaxon@veyr.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "Remove Diacritics",
input: "\xe0, \xe8, \xec, \xf2, \xf9 \xc0, \xc8, \xcc, \xd2, \xd9\n\xe1, \xe9, \xed, \xf3, \xfa, \xfd \xc1, \xc9, \xcd, \xd3, \xda, \xdd\n\xe2, \xea, \xee, \xf4, \xfb \xc2, \xca, \xce, \xd4, \xdb\n\xe3, \xf1, \xf5 \xc3, \xd1, \xd5\n\xe4, \xeb, \xef, \xf6, \xfc, \xff \xc4, \xcb, \xcf, \xd6, \xdc, \u0178\n\xe5, \xc5",
expectedOutput: "a, e, i, o, u A, E, I, O, U\na, e, i, o, u, y A, E, I, O, U, Y\na, e, i, o, u A, E, I, O, U\na, n, o A, N, O\na, e, i, o, u, y A, E, I, O, U, Y\na, A",
recipeConfig: [
{
"op": "Remove Diacritics",
"args": []
},
],
},
]);
+5 -5
View File
@@ -131,7 +131,7 @@ TestRegister.addTests([
recipeConfig: [
{
op: "ROT13",
args: [true, true, 13]
args: [true, true, true, 13]
},
],
},
@@ -142,7 +142,7 @@ TestRegister.addTests([
recipeConfig: [
{
op: "ROT13",
args: [true, true, 13]
args: [true, true, true, 13]
},
],
},
@@ -153,7 +153,7 @@ TestRegister.addTests([
recipeConfig: [
{
op: "ROT13",
args: [true, true, 26]
args: [true, true, true, 26]
},
],
},
@@ -164,7 +164,7 @@ TestRegister.addTests([
recipeConfig: [
{
op: "ROT13",
args: [true, false, 13]
args: [true, false, false, 13]
},
],
},
@@ -175,7 +175,7 @@ TestRegister.addTests([
recipeConfig: [
{
op: "ROT13",
args: [false, true, 13]
args: [false, true, false, 13]
},
],
},
+83
View File
@@ -0,0 +1,83 @@
/**
* Unicode operation tests.
*
* @author Matt C [me@mitt.dev]
* @author Klaxon [klaxon@veyr.com]
*
* @copyright Crown Copyright 2020
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "Unicode Text Format: underline",
input: "a",
expectedOutput: "a\u0332",
recipeConfig: [
{
"op": "Unicode Text Format",
"args": [true, false],
}
],
},
{
name: "Unicode Text Format: strikethrough",
input: "a",
expectedOutput: "a\u0336",
recipeConfig: [
{
"op": "Unicode Text Format",
"args": [false, true],
}
],
},
{
name: "Unicode Text Format: both",
input: "a",
expectedOutput: "a\u0336\u0332",
recipeConfig: [
{
"op": "Unicode Text Format",
"args": [true, true],
}
],
},
{
name: "Remove Diacritics: text formatting",
input: "a",
expectedOutput: "a",
recipeConfig: [
{
"op": "Unicode Text Format",
"args": [true, true],
},
{
"op": "Remove Diacritics",
"args": []
}
],
},
{
name: "Remove Diacritics: all diacritical marks one char",
input: "à̴̵̶̷̸̡̢̧̨̛̖̗̘̙̜̝̞̟̠̣̤̥̦̩̪̫̬̭̮̯̰̱̲̳̹̺̻̼́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̽̾̿̀́͂̓̈́̕̚͠͡ͅ", // sorry about this line lol
expectedOutput: "a",
recipeConfig: [
{
"op": "Remove Diacritics",
"args": []
}
],
},
{
name: "Remove Diacritics: default",
input: "\xe0, \xe8, \xec, \xf2, \xf9 \xc0, \xc8, \xcc, \xd2, \xd9\n\xe1, \xe9, \xed, \xf3, \xfa, \xfd \xc1, \xc9, \xcd, \xd3, \xda, \xdd\n\xe2, \xea, \xee, \xf4, \xfb \xc2, \xca, \xce, \xd4, \xdb\n\xe3, \xf1, \xf5 \xc3, \xd1, \xd5\n\xe4, \xeb, \xef, \xf6, \xfc, \xff \xc4, \xcb, \xcf, \xd6, \xdc, \u0178\n\xe5, \xc5",
expectedOutput: "a, e, i, o, u A, E, I, O, U\na, e, i, o, u, y A, E, I, O, U, Y\na, e, i, o, u A, E, I, O, U\na, n, o A, N, O\na, e, i, o, u, y A, E, I, O, U, Y\na, A",
recipeConfig: [
{
"op": "Remove Diacritics",
"args": []
},
],
},
]);
+4
View File
@@ -34,6 +34,10 @@ const banner = `/**
module.exports = {
output: {
publicPath: "",
globalObject: "this"
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",