MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / rawIdWithTime

Function rawIdWithTime

shared/src/binary.ts:84–89  ·  view source on GitHub ↗
(epochMs: number)

Source from the content-addressed store, hash-verified

82
83// separate from idFactory because it's only used by tests and adds unnecessary complexity/conditionals to idFactory
84export const rawIdWithTime = (epochMs: number) => {
85 const id = new Uint8Array(idLength)
86 crypto.getRandomValues(id)
87 prefixEpochToArray(epochMs, id)
88 return id
89}
90
91export let rawId = idFactory()
92export function hexId(): Hex {

Callers 2

getNotes.test.tsFile · 0.90
base64urlIdWithTimeFunction · 0.85

Calls 1

prefixEpochToArrayFunction · 0.85

Tested by

no test coverage detected