mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
12 lines
289 B
JavaScript
12 lines
289 B
JavaScript
import rs from 'jsrsasign';
|
|
|
|
export function generateFingerprint(caStr) {
|
|
const hex = rs.pemtohex(caStr);
|
|
const fingerPrint = rs.KJUR.crypto.Util.hashHex(hex, 'sha256');
|
|
return fingerPrint.match(/.{2}/g).join(':').toUpperCase();
|
|
}
|
|
|
|
export default {
|
|
generateFingerprint,
|
|
};
|