Badgen.net: Keybase badge

Created on 5 Sep 2018  路  8Comments  路  Source: badgen/badgen.net

Most helpful comment

馃帀 It's live now https://badgen.net/#keybase

All 8 comments

It seems this example can be done with a static badge:

I'm not familiar with keybase, is there some use case needs dynamic content on the badge?

The PGP key can change.

Use this

https://badgen.net/keybase/pgp/:username

to refer one's latest/current PGP key's fingerprint?

馃憤

I would recommend using the 64-bit PGP fingerprint, 32-bit PGP fingerprint's are trivial to brute force: https://evil32.com

Something like:



馃憤 I would still make the badge blue though. That green color is ugly.

Sure, I will submit a PR for this, should be super simple to add.

const user = await fetch('https://keybase.io/_/api/1.0/user/lookup.json?usernames=hyperdex').then(res => res.json()).then(json => json.them[0]);
// `user` will be `null` if there is no matching user

const fingerprint = user.public_keys.primary.key_fingerprint;
const fingerprint64bit = fingerprint.substr(fingerprint.length - 16).toUpperCase().match(/.{1,4}/g).join(' ');
// '31DB EB37 BF19 9A3C'

馃帀 It's live now https://badgen.net/#keybase

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tunnckoCore picture tunnckoCore  路  3Comments

sindresorhus picture sindresorhus  路  6Comments

styfle picture styfle  路  5Comments

tunnckoCore picture tunnckoCore  路  4Comments

styfle picture styfle  路  3Comments