MCPcopy Create free account
hub / github.com/TanStack/db / toBase32

Function toBase32

packages/db-sqlite-persistence-core/src/persisted.ts:2796–2810  ·  view source on GitHub ↗
(input: number)

Source from the content-addressed store, hash-verified

2794}
2795
2796function toBase32(input: number): string {
2797 if (input === 0) {
2798 return PERSISTED_TABLE_NAME_ALPHABET.charAt(0)
2799 }
2800
2801 let value = input >>> 0
2802 let output = ``
2803
2804 while (value > 0) {
2805 output = `${PERSISTED_TABLE_NAME_ALPHABET.charAt(value % 32)}${output}`
2806 value = Math.floor(value / 32)
2807 }
2808
2809 return output
2810}
2811
2812export function createPersistedTableName(
2813 collectionId: string,

Callers 1

createPersistedTableNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected