LONDON—A magnitude 6.4 quake hit about 100 km out in the Pacific off the coast of El Salvador on Friday, the US Geological Survey said.