Facebook Inc said on Friday that hackers stole digital login codes allowing them to take over up to 50 million user accounts, after what has already been a difficult year for the company’s reputation.