Let G be a locally compact, Hausdorff groupoid in which s is a local
homeomorphism and the unit space is totally disconnected. Assume there is a
continuous cocycle c from G into a discrete group Γ. We show that the
collection A(G) of locally-constant, compactly supported functions on G is a
dense *-subalgebra of C_c(G) and that it is universal for algebraic
representations of the collection of compact open bisections of G. We also show
that if G is the groupoid associated to a row-finite graph or k-graph with no
sources, then A(G) is isomorphic to the associated Leavitt path algebra or
Kumjian-Pask algebra. We prove versions of the Cuntz-Krieger and graded
uniqueness theorems for A(G)