The coconut version is called kashata za nazi and the peanut version kashata za karanga, after the Swahili words for coconut and peanut.
Grated coconut or crushed peanuts are cooked down with caramelized sugar and cardamom until the mixture sets into a firm, chewy candy, then cut into small squares. Stone Town market stalls and roadside sweet-sellers keep trays of it on hand as an inexpensive treat and popular souvenir.