@musakui/fedi
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -20,2 +20,3 @@ import { bufToB64, importPrivateKey, importPublicKey } from '../keys/index.js' | ||
/** @type {import('./types').Hasher} */ | ||
const getDigest = async (data, algo = 'SHA-256') => { | ||
@@ -96,2 +97,3 @@ const dg = await crypto.subtle.digest(algo, strToBuf(data)) | ||
mySigner = new Signer(id, key, { algorithm }) | ||
return mySigner | ||
} | ||
@@ -98,0 +100,0 @@ |
@@ -95,6 +95,7 @@ import { createSign, createVerify, createHash } from 'crypto' | ||
* @param {string} key signing key | ||
* @param {string} [algo] signing algorithm | ||
* @param {string} [algo] digest algorithm | ||
*/ | ||
export const useKey = (id, key, algo = 'sha256') => { | ||
mySigner = new Signer(id, key, { hashAlgorithm: algo }) | ||
return mySigner | ||
} | ||
@@ -101,0 +102,0 @@ |
@@ -0,1 +1,3 @@ | ||
import { CoreSigner } from './core' | ||
/** | ||
@@ -36,5 +38,6 @@ * @param {string} data string to hash | ||
/** signer instance */ | ||
signer: Signer | ||
signer: CoreSigner | ||
/** additional headers */ | ||
headers: Record<string, string> | ||
} |
@@ -10,3 +10,3 @@ { | ||
"repository": "github:musakui/fedi", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"type": "module", | ||
@@ -13,0 +13,0 @@ "files": [ |
27581
797