WASHINGTON — The Supreme Court struggled on Tuesday to decide whether federal prosecutors can force American companies to turn over digital data stored outside the United States, in a clash between the demands of law enforcement and technology firms’ desire to shield the information they collect to protect their customers’ privacy.

The case turned on the meaning of a 1986 law, enacted before the dawn of the big-data era, and several justices said it provided them with very limited guidance.

In 1986, Justice Ruth Bader Ginsburg said, no one had ever heard of cloud computing. “This kind of storage didn’t exist,” she said.

That suggested, she said, that Congress rather than the courts should act to define the limits of privacy in the digital era.