The advent of energy "prosumers" that not only consume but also produce energy, advocates a sharing market to encourage energy exchange. Motivated by the recent technology of online platforms, this paper proposes a simple but effective mechanism for energy sharing by generalizing demand bidding. Towards this end, a generic supply-demand function (SDF) is devised for individual prosumers to determine their role of buyer or seller in the sharing market, where the outcome is shown to be a Nash equilibrium (NE) among prosumers. The existence and uniqueness of NE are proved. Properties of the equilibrium price are uncovered. Compared with individual decision-making, the disutility of each prosumer can always be reduced via purchasing cheaper energy in the sharing market, leading to a Pareto improvement. It is revealed that the total cost of prosumers decreases with the price elasticity and the sharing market equilibrium can achieve social optimum when the number of prosumers becomes large enough. It is also found that introducing competition benefits social welfare. Case studies confirm the theoretical results with analyses on the impacts of several key factors. This work is expected to provide insights on understanding and designing future energy sharing markets.