Added hash creation function to xs file
Merged sparkey error code handling