Compare commits

...
3 Commits
Author SHA1 Message Date
n1474335 7272c86592 5.0.1 2017-03-31 16:00:30 +00:00
n1474335 706423462d 'From Base' operation now supports numbers with fractional parts. 2017-03-31 16:00:23 +00:00
n1474335 3788a9161a Updated .travis.yml to add GA code to GH Pages 2017-03-31 09:56:08 +00:00
5 changed files with 24 additions and 18 deletions
+2
View File
@@ -10,6 +10,8 @@ script:
- grunt docs
- grunt node
- grunt prod
before_deploy:
- grunt copy:ghPages
deploy:
- provider: pages
skip_cleanup: true
+1 -15
View File
@@ -28,10 +28,6 @@ module.exports = function (grunt) {
"Creates a production-ready build. Use the --msg flag to add a compile message.",
["eslint", "clean:prod", "webpack:webProd", "inline", "chmod"]);
grunt.registerTask("release",
"Prepares and deploys a production version of CyberChef to the gh-pages branch.",
["copy:ghPages", "exec:deployGhPages"]);
grunt.registerTask("default",
"Lints the code base",
["eslint", "exec:repoSize"]);
@@ -295,7 +291,7 @@ module.exports = function (grunt) {
process: function (content, srcpath) {
// Add Google Analytics code to index.html
content = content.replace("</body></html>",
grunt.file.read("src/static/ga.html") + "</body></html>");
grunt.file.read("src/web/static/ga.html") + "</body></html>");
return grunt.template.process(content);
}
},
@@ -328,16 +324,6 @@ module.exports = function (grunt) {
cleanGit: {
command: "git gc --prune=now --aggressive"
},
deployGhPages: {
command: [
"git add build/prod/index.html -v",
"COMMIT_HASH=$(git rev-parse HEAD)",
"git commit -m \"GitHub Pages release for ${COMMIT_HASH}\"",
"git push origin `git subtree split --prefix build/prod master`:gh-pages --force",
"git reset HEAD~",
"git checkout build/prod/index.html"
].join(";")
}
},
execute: {
test: "build/test/index.js"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cyberchef",
"version": "5.0.0",
"version": "5.0.1",
"description": "CyberChef is a simple, intuitive web app for analysing and decoding data within a web browser.",
"author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef",
+13 -1
View File
@@ -46,7 +46,19 @@ const Base = {
if (radix < 2 || radix > 36) {
throw "Error: Radix argument must be between 2 and 36";
}
return parseInt(input.replace(/\s/g, ""), radix);
var number = input.replace(/\s/g, "").split("."),
result = parseInt(number[0], radix) || 0;
if (number.length === 1) return result;
// Fractional part
for (var i = 0; i < number[1].length; i++) {
var digit = parseInt(number[1][i], radix);
result += digit / Math.pow(radix, i+1);
}
return result;
},
};
+7 -1
View File
@@ -13,7 +13,13 @@ const CyberChef = module.exports = {
bake: function(input, recipeConfig) {
this.chef = new Chef();
return this.chef.bake(input, recipeConfig, {}, 0, false);
return this.chef.bake(
input,
recipeConfig,
{},
0,
false
);
}
};