MCPcopy Index your code
hub / github.com/cameri/nostream / createIdentity

Function createIdentity

test/integration/features/helpers.ts:53–66  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

51}
52
53export function createIdentity(name: string) {
54 const buffer = new Uint32Array(10)
55 getRandomValues(buffer)
56 const hmac = createHmac('sha256', buffer)
57 hmac.update(name)
58 const privkey = hmac.digest().toString('hex')
59 const pubkey = Buffer.from(secp256k1.getPublicKey(privkey, true)).toString('hex').substring(2)
60 const author = {
61 name,
62 privkey,
63 pubkey,
64 }
65 return author
66}
67
68export async function createSubscription(
69 ws: WebSocket,

Callers 2

shared.tsFile · 0.90

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected