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

Function idToEpoch

shared/src/binary.ts:46–52  ·  view source on GitHub ↗
(id: Uint8Array)

Source from the content-addressed store, hash-verified

44}
45
46export function idToEpoch(id: Uint8Array): number {
47 let epoch = 0
48 for (let i = 0; i < epochLength; i++) {
49 epoch = epoch * 256 + id[i]!
50 }
51 return epoch
52}
53
54export function incrementRandom(arr: Uint8Array): void {
55 for (let i = idLength - 1; i >= epochLength; i--) {

Callers 4

getNotes.test.tsFile · 0.90
binary.test.tsFile · 0.90
idToDateFunction · 0.85
rawIdToDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected