Actually, $hget(table,0).item will return the number of items in the table.

Quote:
$hget(name/N, N).item
This allows you to reference the table as an index from 0 to N, in order to look up the Nth item in the table.
If N is zero, returns the total number of items in the table.
You can also reference the Nth data value directly with $hget().data.
Note: This method is provided as a convenience, it is not an efficient way to use the hash table.