-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6be403
commit cd57527
Showing
6 changed files
with
93 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { computed } from "vue"; | ||
const props = defineProps<{ | ||
fingerprint: string | ||
fingerprint: string; | ||
}>(); | ||
// There's nothing particularly special about this format but it's the same as the GPG CLI prints and | ||
// it's what people are used to looking at for GPG keys. Hopefully that means its a little easier to | ||
// 40 characters grouped together. | ||
const fingerprintDisplay = computed(() => { | ||
// It's a 160 bit hash, so 20 bytes, in hex is 40 characters | ||
if (!props.fingerprint || props.fingerprint.length != 40) return ''; | ||
// It's a 160 bit hash, so 20 bytes, in hex is 40 characters | ||
if (!props.fingerprint || props.fingerprint.length != 40) return ""; | ||
let repr = ''; | ||
for (let i = 0; i < 40; i += 4) { | ||
repr += props.fingerprint.slice(i, i + 4) + ' '; | ||
let repr = ""; | ||
for (let i = 0; i < 40; i += 4) { | ||
repr += props.fingerprint.slice(i, i + 4) + " "; | ||
if (i === 20) repr += ' '; | ||
} | ||
if (i === 20) repr += " "; | ||
} | ||
return repr.trim(); | ||
return repr.trim(); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<span>{{ fingerprintDisplay }}</span> | ||
</template> | ||
<span>{{ fingerprintDisplay }}</span> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters