Skip to content

Commit 517302b

Browse files
authored
Merge branch 'master' into certificate
2 parents f5d6ef1 + 314a14a commit 517302b

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,36 @@ Cryptographic operations in CyberChef should not be relied upon to provide secur
2020

2121
[A live demo can be found here][1] - have fun!
2222

23-
## Containers
23+
## Running Locally with Docker
2424

25-
If you would like to try out CyberChef locally you can either build it yourself:
25+
**Prerequisites**
2626

27+
- [Docker](hhttps://www.docker.com/products/docker-desktop/)
28+
- Docker Desktop must be open and running on your machine
29+
30+
31+
#### Option 1: Build the Docker Image Yourself
32+
33+
1. Build the docker image
2734
```bash
2835
docker build --tag cyberchef --ulimit nofile=10000 .
36+
```
37+
2. Run the docker container
38+
```bash
2939
docker run -it -p 8080:80 cyberchef
3040
```
41+
3. Navigate to `http://localhost:8080` in your browser
42+
43+
#### Option 2: Use the pre-built Docker Image
3144

32-
Or you can use our image directly:
45+
If you prefer to skip the build process, you can use the pre-built image
3346

3447
```bash
3548
docker run -it -p 8080:80 ghcr.io/gchq/cyberchef:latest
3649
```
3750

51+
Just like before, navigate to `http://localhost:8080` in your browser.
52+
3853
This image is built and published through our [GitHub Workflows](.github/workflows/releases.yml)
3954

4055
## How it works

src/core/operations/ShowOnMap.mjs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
22
* @author j433866 [j433866@gmail.com]
3-
* @copyright Crown Copyright 2019
3+
* @author 0xff1ce [github.com/0xff1ce]
4+
* @copyright Crown Copyright 2024
45
* @license Apache-2.0
56
*/
67

@@ -22,7 +23,7 @@ class ShowOnMap extends Operation {
2223
this.name = "Show on map";
2324
this.module = "Hashing";
2425
this.description = "Displays co-ordinates on a slippy map.<br><br>Co-ordinates will be converted to decimal degrees before being shown on the map.<br><br>Supported formats:<ul><li>Degrees Minutes Seconds (DMS)</li><li>Degrees Decimal Minutes (DDM)</li><li>Decimal Degrees (DD)</li><li>Geohash</li><li>Military Grid Reference System (MGRS)</li><li>Ordnance Survey National Grid (OSNG)</li><li>Universal Transverse Mercator (UTM)</li></ul><br>This operation will not work offline.";
25-
this.infoURL = "https://foundation.wikimedia.org/wiki/Maps_Terms_of_Use";
26+
this.infoURL = "https://osmfoundation.org/wiki/Terms_of_Use";
2627
this.inputType = "string";
2728
this.outputType = "string";
2829
this.presentType = "html";
@@ -85,10 +86,10 @@ class ShowOnMap extends Operation {
8586
data = "0, 0";
8687
}
8788
const zoomLevel = args[0];
88-
const tileUrl = "https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png",
89-
tileAttribution = "<a href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia maps</a> | &copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
90-
leafletUrl = "https://unpkg.com/leaflet@1.5.0/dist/leaflet.js",
91-
leafletCssUrl = "https://unpkg.com/leaflet@1.5.0/dist/leaflet.css";
89+
const tileUrl = "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
90+
tileAttribution = "&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
91+
leafletUrl = "https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",
92+
leafletCssUrl = "https://unpkg.com/leaflet@1.9.4/dist/leaflet.css";
9293
return `<link rel="stylesheet" href="${leafletCssUrl}" crossorigin=""/>
9394
<style>
9495
#output-text .cm-content,

src/core/operations/ToDecimal.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ class ToDecimal extends Operation {
4545
* @returns {string}
4646
*/
4747
run(input, args) {
48-
input = new Uint8Array(input);
4948
const delim = Utils.charRep(args[0]),
5049
signed = args[1];
5150
if (signed) {
52-
input = input.map(v => v > 0x7F ? v - 0xFF - 1 : v);
51+
input = new Int8Array(input);
52+
} else {
53+
input = new Uint8Array(input);
5354
}
5455
return input.join(delim);
5556
}

0 commit comments

Comments
 (0)