-
Notifications
You must be signed in to change notification settings - Fork 0
/
componentes.vue
52 lines (44 loc) · 1.34 KB
/
componentes.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<div>
<h1>Encoder</h1>
<input v-model="message" placeholder="Enter the message" />
<input v-model.number="turns" type="number" placeholder="Number of columns" />
<button @click="encode">Encode</button>
<p>{{ encodedMessage }}</p>
</div>
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { escitalaEncrypt } from "./escitala"; // Importa las funciones de cifrado y descifrado
@Component
export default class Encode extends Vue {
message: string = "";
turns: number = 0;
encodedMessage: string = "";
encode() {
this.encodedMessage = escitalaEncrypt(this.message, this.turns);
}
}
</script>
<template>
<div>
<h1>Decoder</h1>
<input v-model="message" placeholder="Enter the message" />
<input v-model.number="turns" type="number" placeholder="Number of columns" />
<button @click="decode">Decode</button>
<p>{{ decodedMessage }}</p>
</div>
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { escitalaDecrypt } from "./escitala"; // Importa las funciones de cifrado y descifrado
@Component
export default class Decode extends Vue {
message: string = "";
turns: number = 0;
decodedMessage: string = "";
decode() {
this.decodedMessage = escitalaDecrypt(this.message, this.turns);
}
}
</script>